Ballmac UI home

Morphing Text

Words melt into each other with a blur and threshold effect, cycling through a list, pausing when off screen, with a box that never jumps in width.

Design, Build, Ship, Repeat

Installation

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

Usage

import { MorphingText } from "@/components/ballmac/morphing-text"

The full example is in the Code tab above.

Examples

Inline in a sentence

Made fordesigners, founders, engineers, everyone

API reference

PropTypeDefault
texts*

The words or phrases to morph between, in order.

string[]—
hold

Milliseconds each text is held before the next morph starts.

number1400
morph

Milliseconds the morph itself takes.

number1100

Also accepts the standard attributes of its root element.

Accessibility

KeyAction
Screen readersAll texts are read once as a list; the morph is hidden
Reduced motionThe first text is shown still

Use with AI

<MorphingText texts={['Build','Ship','Scale']} hold morph className='text-6xl' />. The size comes from className. Uses an SVG threshold filter; the loop stops when off screen or when reduced motion is on. With the shadcn MCP server set up (guide), ask your agent:

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

Use it for

  • A hero word that changes between a few options
  • Brand or product-name reveals

Not for

  • Small body text (the effect needs large type)
  • Many words per frame

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

Credits

Free to use in personal and commercial projects.

Registry
shadcn/utils