Split Flap
Split-flap display that flips each character through the alphabet like a departure board, with a column ripple, tones, sizes and reduced motion support.
Installation
npx shadcn@latest add @minidev/split-flap
MiniDev UI is in the shadcn registry directory, so the short form works with no setup. Older CLI versions can use the full URL: npx shadcn@latest add https://ui.minidev.pro/r/split-flap.json
Usage
import { SplitFlap } from "@/components/ui/split-flap"
export function Example() {
return (
<SplitFlap />
)
}
API reference
| Prop | Type | Default |
|---|---|---|
| valueText to flip to. Change it to flip again from the current characters. | string | "NOW BOARDING" |
| lengthPad or cut to this many cells. | number | - |
| speedMilliseconds per single flip. | number | 70 |
| staggerExtra delay per column, for the ripple. | number | 28 |
| sizeCell size: 24px, 32px or 48px tall. | "sm""default""lg" | "default" |
| toneColour of the characters. | "default""accent""success""warning""danger" | "default" |
| className | string | - |
When to use
Top half falls over the bottom with a staggered start per column. Screen readers get the final text once; the flipping is decoration.
The board is always dark (it scopes the dark tokens to itself). Supported characters: A-Z, 0-9, space and : . - ' / ·; anything else shows blank. Use it for a headline status or a launch moment; for a changing number in a dashboard use NumberRoll, which is quieter.
Accessibility
- Screen readers get
valueonce from ansr-onlyspan; every cell isaria-hidden. - It is not a live region, so a new
valueis not announced. Add your ownaria-livetext if the change matters. - Under reduced motion each cell shows its target character at once.
Frequently asked questions
How long does a SplitFlap take to settle?
Each cell flips forward through the character set one step at a time, speed milliseconds per step (70 by default), and columns start stagger ms apart. A cell going from blank to Z takes 26 steps, about two seconds. Flaps never go backwards, so changing B to A goes all the way round.
Which characters can SplitFlap show?
A to Z, 0 to 9, space and : . - ' / ·. Lowercase is converted to uppercase, and anything else shows as a blank cell. length pads or cuts the text to a fixed number of cells so the board width never changes.
Why is the board dark in light mode?
It adds the dark class to itself, so the dark tokens apply inside it in both themes, like a real departure board. tone colours the characters.
Dependencies
npm
Built from
Examples
Status that changes
Change value and each cell flips forward from its current letter; a fixed length keeps the board width steady.
Launch headline
A large board for one moment on a launch page; speed and stagger set how fast the ripple crosses the row.