Text Animations
Beautiful animated text effects powered by GSAP
All text animations require GSAP to be installed first. No global CSS setup required - the component is fully self-contained and inherits styles automatically.
Install GSAP
npm install gsapAdd the component
npx shadcn@latest add https://glsilk.vercel.app/r/split-text-animation.jsonQuick Start
import { SplitTextAnimation } from "@/components/ui/split-text-animation";
export default function Home() {
return (
<SplitTextAnimation
text="Hello World"
animationType="fade"
duration={0.8}
stagger={0.03}
/>
);
}Examples
Default
<SplitTextAnimation
text="Beautiful Fade In Animation"
animationType="fade"
duration={0.8}
stagger={0.03}
/>Animation Types
Explore different animation types:
Fade Animation
Simple fade-in effect
Slide Animation
Slide from any direction
Scale Animation
Scale with bounce effect
Rotate Animation
Rotating text effect
Custom Styling
Custom Styling
The component automatically inherits all font properties (size, weight, family, color) from its container. Apply any Tailwind classes or custom CSS to the component and all styles will be applied to each animated character:
<SplitTextAnimation
text="Custom Styled Text"
className="text-2xl text-green-500"
animationType="fade"
/>Supported CSS classes:
- Text sizing:
text-sm,text-lg,text-4xl, etc. - Font weight:
font-normal,font-bold,font-black, etc. - Colors:
text-blue-500,text-red-600, etc. - Custom styles:
font-mono,tracking-wider,italic, etc. - Gradients:
bg-gradient-to-r from-pink-500 to-violet-500 bg-clip-text text-transparent
API Reference
Prop
Type
Credits
- GSAP: greensock.com
- GitHub: greensock/GSAP