Skip to content

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.

src/registry/ui/split-flap.tsx/r/split-flap.json

Installation

bash
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

tsx
import { SplitFlap } from "@/components/ui/split-flap"

export function Example() {
  return (
    <SplitFlap />
  )
}

API reference

SplitFlap props
PropTypeDefault
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.number70
staggerExtra delay per column, for the ripple.number28
sizeCell size: 24px, 32px or 48px tall."sm""default""lg""default"
toneColour of the characters."default""accent""success""warning""danger""default"
classNamestring-

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 value once from an sr-only span; every cell is aria-hidden.
  • It is not a live region, so a new value is not announced. Add your own aria-live text 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

motion

Built from

No other MiniDev files

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.

All Animated React components

Learn more