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-mergeThen copy 3 files into your project:
- components/registry/split-flap/split-flap.tsx
- hooks/use-animation-loop.ts
- lib/utils.ts
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| 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. |
| flapDuration | number | 90 | Time 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. |
| stagger | number | 45 | Delay 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. |
| settleBounce | number | 0.5 | Overshoot as a flap hits its stop. This is follow-through: the card has mass, so it arrives slightly past and comes back. |
| cardGap | number | 4 | Space between one card stack and the next. |
| seamWeight | number | 1 | The 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. |
| specular | number | 0.55 | Light sweeping across a moving flap, brightest edge-on. Without it a flip reads as a rectangle changing shape rather than as a surface turning. |
| perspective | number | 420 | Depth of the foreshortening. Lower exaggerates the hinge and puts the viewer close to the board; higher flattens it toward a straight fold. |
| cardColor | string (hex) | "#17141d" | Body of the cards. Its own material, not a themed surface — a departure board is a dark object in any room. |
| glyphColor | string (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
Neon
A neon sign, with everything that is wrong with a neon sign. Tubes strike one at a time rather than together, each settling at its own moment inside the ignition. The steady state carries a mains hum, and every so often one tube gives up for a third of a second and comes back. The glow is baked once per letter into a sprite, so a frame is a handful of draws no matter how wide the word, and the word itself never stops being a real, selectable text node underneath.
Flipdot
A mechanical flip-dot sign. Each word is drawn on a grid of small discs. To show the next word, the discs turn over in a sweep: by column, on a diagonal, out from the center, or at random. A disc squashes as it turns and swings a little past flat before it settles. Hover to flip the discs under the pointer, or click to send a wave across the sign.
Reel
A sentence with one slot that keeps changing. The words sit on a drum. The next word rolls up from below while the old one rolls away over the top, as a whole word or letter by letter. The slot's width springs to fit each new word, so the rest of the sentence is pushed along and does not jump. A screen reader gets every word once, as a list.
Animated Number
Animated numeric transitions with flip, slide, fade, and bounce styles.
Scramble Text
Ciphered glyphs boiling out of noise and resolving into words. A decode cascade that settles character by character, a hover that re-scrambles on demand, or a continuous low glitch that keeps the type restless, each freshly-resolved letter flashing accent before it cools to ink.
Specter
Spectral RGB-split echoes drift off the letters and dissolve into the dark.