Text Animate

Staggered entrance animations for headlines and copy, split by word, character, or line.

Animate your ideas into reality

Installation

pnpm dlx shadcn@latest add @godui/text-animate

Requires the @godui namespace in your components.json (one-time setup):

{  "registries": {    "@godui": "https://godui.design/r/{name}.json"  }}

TextAnimate requires framer-motion as a peer dependency:

npm install framer-motion

Usage

import { TextAnimate } from "@/components/godui/text-animate";

Word fade in

<TextAnimate animation="fadeIn" by="word" className="text-4xl">
  Animate your ideas into reality
</TextAnimate>

Character stagger

<TextAnimate animation="slideUp" by="character" stagger={0.03} className="text-3xl">
  Character by character
</TextAnimate>

Scroll into view

<TextAnimate animation="blurInUp" startOnView once className="text-5xl font-bold">
  Scroll to reveal
</TextAnimate>

Semantic heading

<TextAnimate as="h1" animation="scaleUp" by="word" className="text-5xl font-bold">
  Hero headline
</TextAnimate>

Examples

Hit the replay button on any preview to play the animation again.

Word fade in

Animate your ideas into reality

Character stagger

Character by character

Scale up

Scale up with spring

Slide from the right

Slide from the right

Semantic heading

Render a real h1 with as while keeping the staggered entrance.

Hero headline

Props

PropTypeDefaultDescription
childrenstringText content to animate
animation"fadeIn" | "blurIn" | "blurInUp" | "blurInDown" | "slideUp" | "slideDown" | "slideLeft" | "slideRight" | "scaleUp" | "scaleDown""fadeIn"Entrance animation preset
by"text" | "word" | "character" | "line""word"How to split text for staggering
as"p" | "h1"–"h6" | "span" | "div" | …"p"Root element to render
delaynumber0Delay before animation starts (seconds)
durationnumber0.3Total animation duration; also drives default stagger when stagger is omitted
staggernumberderivedDelay between each segment
startOnViewbooleantrueAnimate when the element enters the viewport
oncebooleantrueAnimate only the first time it enters view, then never again
viewportAmountnumber | "some" | "all"0.3How much of the element must be visible to trigger
accessiblebooleantrueScreen-reader text with aria-hidden on animated segments
classNamestringClasses on the root element
segmentClassNamestringClasses on each animated segment
variantsVariantsCustom Framer Motion item variants

Respects prefers-reduced-motion — text renders immediately without animation when the user has reduced motion enabled.

On this page