Text that swaps for a second line on hover, its letters rolling one after another under a wave of color.
pnpm dlx shadcn@latest add @latheui/stagger-textPart of Lathe Pro. Set up your project once with your license key: npx latheui init --key <key>. See Lathe Pro.
Stagger Text is part of Lathe Pro
The preview is live and free to try. The source, the install and every assembly come with Pro: $79 once, with lifetime updates.
Depends on
Also accepts native span attributes. Size and weight come from className.
| Prop | Type | Default | Description |
|---|---|---|---|
| text* (required) | string | — | Text at rest. This is what assistive tech reads. |
| hoverText* (required) | string | — | Text while hovered or active. |
| interval | number | 28 | Milliseconds between letters. |
| colors | string[] | chart tokens 1, 3 and 4 | Colors the letters pass through. Any CSS colors. An empty array turns the wave off. |
| active | boolean | — | Controlled state. |
| onActiveChange | (active: boolean) => void | — | Called when hover or a tap changes the state. |
<StaggerText
text="Design"
hoverText="Engineer"
interval={45}
colors={["var(--chart-2)", "var(--chart-5)"]}
/>