Ballmac UI home

Text Animate

Reveals text by character, word or line with eight entrances (fade, blur, slide, scale, rotate), staggered and triggered on scroll, with the full text kept for screen readers.

Design systems that feel alive

Each line arrives on its own. Nothing moves if you prefer it that way.

Installation

$ pnpm dlx shadcn@latest add @ballmac/text-animate

Usage

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

The full example is in the Code tab above.

Examples

By character, five entrances

  • Hello, worldfadeIn
  • Hello, worldslideUp
  • Hello, worldscaleUp
  • Hello, worldrotateIn
  • Hello, worldslideLeft

API reference

PropTypeDefault
children*

The text. Use a newline to break lines.

string—
by

What is animated one after another.

"character" | "word" | "line""word"
animation

How each piece arrives.

TextAnimation"blurIn"
stagger

Seconds between pieces. Defaults to a pace that suits `by`.

number—
duration

Seconds each piece takes.

number0.4
delay

Seconds before the first piece.

number0
inView

Wait for the text to scroll into view.

booleantrue
once

Play once.

booleantrue
as

Element to render.

TextAnimateTag"span"

Also accepts the standard attributes of its root element.

Accessibility

KeyAction
Screen readersThe full text is in a hidden element; animated pieces are aria-hidden
Reduced motionText is shown immediately

Use with AI

<TextAnimate by='word|character|line' animation='blurIn|fadeIn|slideUp|slideDown|slideLeft|slideRight|scaleUp|rotateIn'>Text</TextAnimate>. Newlines make lines. as picks the element. With the shadcn MCP server set up (guide), ask your agent:

Add the Ballmac UI Text Animate (@ballmac/text-animate) to this project with the shadcn MCP, then use it where it fits.

Use it for

  • Headlines and short statements that should make an entrance
  • Section titles revealed on scroll

Not for

  • Paragraphs of body text
  • Text that changes often (use word-rotate or typing-text)

Registry JSON: https://ui.ballmac.com/r/text-animate.json

Credits

Free to use in personal and commercial projects.

Registry
shadcn/utils