Ballmac UI home

Text Reveal

Reveals a headline or paragraph word by word or character by character with a soft blur and rise, when it scrolls into view or on mount.

Interfaces that feel measured, not decorated.

Motion with a purpose, tuned like an instrument.

Installation

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

Usage

import { TextReveal } from "@/components/ballmac/text-reveal"

The full example is in the Code tab above.

Examples

By character

Release 4.2

Now in beta

API reference

PropTypeDefault
children*

The text to reveal. Plain text only, so it can be split and read out once.

string—
by

Split into words (default) or single characters.

"word" | "char""word"
as

The element to render. Defaults to "p".

TextRevealElement"p"
trigger

"inView" (default) waits until the text scrolls into view; "mount" starts right away.

"inView" | "mount""inView"
once

Play only the first time the text enters the viewport. Defaults to true.

booleantrue
delay

Seconds before the first piece appears.

number0
step

Seconds between pieces. Defaults to 0.06 for words and 0.018 for characters.

number—

Also accepts the standard attributes of its root element.

Use with AI

Wrap a plain string: <TextReveal as="h1">Ship the interface</TextReveal>. Screen readers get the full text once from a visually hidden copy; the animated pieces are aria-hidden. Under reduced motion it renders plain text. With the shadcn MCP server set up (guide), ask your agent:

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

Use it for

  • Hero headlines and section titles on marketing pages
  • A short tagline that should land after the page loads (trigger="mount")
  • Pull quotes or statements revealed as the reader scrolls

Not for

  • Body copy, UI labels or anything users need to read immediately
  • Rich text with links or inline elements (children must be a plain string)
  • Streaming AI output (render tokens as they arrive instead)

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

Credits

Free to use in personal and commercial projects.