Text Animations

Split Flap

A Solari departure board. Every column walks the charset one flap at a time until it reaches its letter, so the word is never revealed — it is arrived at, with a real hinged half falling away as the next one seats behind it.

Install

bun add clsx tailwind-merge

Then copy 3 files into your project:

  • components/registry/split-flap/split-flap.tsx
  • hooks/use-animation-loop.ts
  • lib/utils.ts

Props

PropTypeDefaultDescription
charset"alphanumeric" | "letters" | "digits" | "departures""alphanumeric"Which glyphs a column walks through on its way to its letter. This is what sets the length of the journey — a digits-only board lands almost immediately, a full alphanumeric one takes its time.
flapDurationnumber90Time for one flap. Under about 50ms the column reads as a blur rather than as discrete cards, which throws away the whole point of the mechanism.
staggernumber45Delay between one column starting and the next. At 0 the board moves as one slab; a small offset is what makes it sound like a board even in silence.
settleBouncenumber0.5Overshoot as a flap hits its stop. This is follow-through: the card has mass, so it arrives slightly past and comes back.
cardGapnumber4Space between one card stack and the next.
seamWeightnumber1The hairline across the middle of a card, where the two halves meet. Kept in the DOM rather than drawn, so the browser snaps it to the pixel grid instead of letting it shimmer on fractional scaling.
specularnumber0.55Light sweeping across a moving flap, brightest edge-on. Without it a flip reads as a rectangle changing shape rather than as a surface turning.
perspectivenumber420Depth of the foreshortening. Lower exaggerates the hinge and puts the viewer close to the board; higher flattens it toward a straight fold.
cardColorstring (hex)"#17141d"Body of the cards. Its own material, not a themed surface — a departure board is a dark object in any room.
glyphColorstring (hex)"#e8e4ee"The printed characters.

What It Demonstrates

Stepped animation
An animation that is divided into discrete steps, like a countdown timer.
Stagger
Animate several items one after another with a small delay between each, creating a cascade.
3D tilt / Flip
Rotate in 3D space (rotateX / rotateY) to add depth.
Perspective
How strong the 3D effect looks — a lower value exaggerates depth, like the viewer is closer.
Loop
An animation that repeats, a set number of times or infinitely.
Follow-through
Parts of an element keep moving and settle slightly after the main motion stops, adding weight.
Tabular numbers
Fixed-width digits so numbers don't shift around as they change. Essential for tickers, timers, and counters.

Related Components

Appears In