Ballmac UI home

Hyper Text

Characters flip through random letters like a split-flap board and settle left to right, as plain text or on tiles, on load, on scroll or on hover and focus.

DeparturesGate B14

Installation

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

Usage

import { HyperText } from "@/components/ballmac/hyper-text"

The full example is in the Code tab above.

Examples

Replay on hover

Hover me

Also replays when focused with the keyboard.

API reference

PropTypeDefault
children*

The final text.

string—
trigger

When to play. "hover" also plays on keyboard focus.

"mount" | "inView" | "hover""mount"
variant

"tiles" draws each character on a split-flap tile.

"plain" | "tiles""plain"
speed

Milliseconds between flips of one character.

number55
spread

Extra flips each character makes, per position, so the word settles left to right.

number2
onComplete

Called when every character has settled.

() => void—

Also accepts the standard attributes of its root element.

Accessibility

KeyAction
TabReaches the text when trigger is hover; focus replays the animation
Screen readersThe real text is read once; the flipping characters are hidden
Reduced motionCharacters appear settled

Use with AI

<HyperText trigger='mount|inView|hover' variant='plain|tiles' speed spread>TEXT</HyperText>. Text is uppercased. The hover trigger is focusable and replays on focus. With the shadcn MCP server set up (guide), ask your agent:

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

Use it for

  • Brand words, status boards, dates and counters
  • Playful hover headings

Not for

  • Anything that must stay readable mid-animation
  • Long sentences

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

Credits

Free to use in personal and commercial projects.

Registry
shadcn/utils