We are working on new components <3
HextaUIHextaUI

Blurred Stagger

A stagger effect for text with a blur filter.

Preview

Hello World!

Code

BlurredStagger.tsx
"use client";
 
import { motion } from "motion/react";
 
export const BlurredStagger = ({
  text = "we love hextaui.com ❤️",
}: {
  text: string;
}) => {
  const headingText = text;
 
  const container = {
    hidden: { opacity: 0 },
    show: {
      opacity: 1,
      transition: {
        staggerChildren: 0.015,
      },
    },
  };
 
  const letterAnimation = {
    hidden: {
      opacity: 0,
      filter: "blur(10px)",
    },
    show: {
      opacity: 1,
      filter: "blur(0px)",
    },
  };
 
  return (
    <>
      <div>
        <motion.h1
          variants={container}
          initial="hidden"
          animate="show"
          className="text-base"
        >
          {headingText.split("").map((char, index) => (
            <motion.span
              key={index}
              variants={letterAnimation}
              transition={{ duration: 0.3 }}
            >
              {char === " " ? "\u00A0" : char}
            </motion.span>
          ))}
        </motion.h1>
      </div>
    </>
  );
};

Usage

index.tsx
import { BlurredStagger } from "@/components/library/text/BlurredStagger";
 
<div>
  <BlurredStagger text="HextaUI is awesome ❤️" />
</div>;

Props

PropTypeDefault
text
string
-
Edit on GitHub

Last updated on

On this page