🌫️ Blur Text
Make your text animation stand out with BlurText! ✨ Watch as each letter smoothly sharpens into focus as it comes into view, creating a stunning blur-to-clear effect. Perfect for dramatic reveals, mysterious aesthetics, interactive UI elements, and engaging landing pages, this React component uses Framer Motion to add a sleek and modern touch to your website. 👀🔮
Preview
Follow below steps 👇🏻
Install dependencies
1npm i framer-motion
Component
Create a file blur-text.tsx in your components folder and paste this code
1import { motion } from 'framer-motion';2import { FC } from 'react';34type BlurTextProps = {5text: string;6className?: string;7};89const BlurText: FC<BlurTextProps> = ({ text, className }) => {10return (11<div className={`flex flex-wrap overflow-visible ${className}`}>12{text.split('').map((char, index) => (13<motion.span14key={index}15initial={{ y: 10, filter: 'blur(10px)' }}16whileInView={{ y: 0, filter: 'blur(0px)' }}17transition={{18duration: 0.2,19delay: index * 0.1,20ease: 'backOut'21}}22className="inline-block"23>24{char === ' ' ? ' ' : char}25</motion.span>26))}27</div>28);29};3031export default BlurText;
Usage
1<BlurText2text="Now you see me"3className="text-yellow-500 text-2xl sm:text-3xl md:text-4xl font-extrabold"4></BlurText>
⭐️ Got a question or feedback?
Feel free to reach out!