Getting Started
Components
Device Mocks
Special Effects
Animations
Text Animations
Buttons
Blur in by characterBlur in by character
import { TextAnimate } from "@/registry/magicui/text-animate";
export function TextAnimateDemo() {
return (
<TextAnimate animation="blurInUp" by="character" once>
Blur in by character
</TextAnimate>
);
}
Installation
pnpm dlx shadcn@latest add @magicui/text-animate
Examples
Blur In by Text
Blur in textBlur in text
import { TextAnimate } from "@/registry/magicui/text-animate";
export function TextAnimateDemo2() {
return (
<TextAnimate animation="blurIn" as="h1">
Blur in text
</TextAnimate>
);
}
Slide Up by Word
Slide up by wordSlide up by word
import { TextAnimate } from "@/registry/magicui/text-animate";
export function TextAnimateDemo3() {
return (
<TextAnimate animation="slideUp" by="word">
Slide up by word
</TextAnimate>
);
}
Scale Up by Text
Scale up by textScale up by text
import { TextAnimate } from "@/registry/magicui/text-animate";
export function TextAnimateDemo4() {
return (
<TextAnimate animation="scaleUp" by="text">
Scale up by text
</TextAnimate>
);
}
Fade In by Line
Fade in by line as paragraph Fade in by line as paragraph Fade in by line as paragraphFade in by line as paragraphFade in by line as paragraphFade in by line as paragraph
import { TextAnimate } from "@/registry/magicui/text-animate";
export function TextAnimateDemo5() {
return (
<TextAnimate animation="fadeIn" by="line" as="p">
{`Fade in by line as paragraph\n\nFade in by line as paragraph\n\nFade in by line as paragraph`}
</TextAnimate>
);
}
Slide Left by Character
Slide left by characterSlide left by character
import { TextAnimate } from "@/registry/magicui/text-animate";
export function TextAnimateDemo6() {
return (
<TextAnimate animation="slideLeft" by="character">
Slide left by character
</TextAnimate>
);
}
With Delay
Blur in by characterBlur in by character
import { TextAnimate } from "@/registry/magicui/text-animate";
export function TextAnimateDemo7() {
return (
<TextAnimate animation="blurInUp" by="character" delay={2}>
Blur in by character
</TextAnimate>
);
}
With Duration
Blur in by characterBlur in by character
import { TextAnimate } from "@/registry/magicui/text-animate";
export function TextAnimateDemo8() {
return (
<TextAnimate animation="blurInUp" by="character" duration={5}>
Blur in by character
</TextAnimate>
);
}
With Custom Motion Variants
Wavy Motion!Wavy Motion!
"use client";
import { TextAnimate } from "@/registry/magicui/text-animate";
export function TextAnimateDemo9() {
return (
<TextAnimate
variants={{
hidden: {
opacity: 0,
y: 30,
rotate: 45,
scale: 0.5,
},
show: (i) => ({
opacity: 1,
y: 0,
rotate: 0,
scale: 1,
transition: {
delay: i * 0.1,
duration: 0.4,
y: {
type: "spring",
damping: 12,
stiffness: 200,
mass: 0.8,
},
rotate: {
type: "spring",
damping: 8,
stiffness: 150,
},
scale: {
type: "spring",
damping: 10,
stiffness: 300,
},
},
}),
exit: (i) => ({
opacity: 0,
y: 30,
rotate: 45,
scale: 0.5,
transition: {
delay: i * 0.1,
duration: 0.4,
},
}),
}}
by="character"
>
Wavy Motion!
</TextAnimate>
);
}
Usage
import { TextAnimate } from "@/components/magicui/text-animate";
<TextAnimate animation="blurInUp" by="word">
Blur in by word
</TextAnimate>
Props
Prop | Type | Default | Description |
---|---|---|---|
children | string | - | The text content to animate |
className | string | - | The class name to be applied to the component |
delay | number | 0 | Delay before animation starts |
duration | number | 0.3 | Duration of the animation |
variants | Variants | - | Custom motion variants for the animation |
as | ElementType | "p" | The element type to render |
by | "text" | "word" | "character" | "line" | "word" | How to split the text ("text", "word", "character") |
startOnView | boolean | true | Whether to start animation when component enters viewport |
once | boolean | false | Whether to animate only once |
animation | AnimationVariant | "fadeIn" | The animation preset to use |
On This Page
InstallationExamplesBlur In by TextSlide Up by WordScale Up by TextFade In by LineSlide Left by CharacterWith DelayWith DurationWith Custom Motion VariantsUsagePropsLimited Time Offer
Ship Faster with Magic UI ProMagic UI Pro
Stop building from scratch.
Get 8 production-ready templates and 50+ premium components that your users will love.
✓
Next.js 15 + TypeScript ready✓
Copy, paste, customize in minutes✓
Save 100+ hours of development