Split-Flap
A rotating word for your headline, set on a split-flap board: each letter is a module that turns forward through its cards until its own comes up, so a new word settles in a staggered clatter. It sits inline and takes the size and font of the text around it; a click turns to the next word.
Needs: None. DOM and the Web Animations API. The clatter uses Web Audio and only plays after a click.
Customize
align
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| words | string[] | required | The words the board turns through. One word just flips in once. |
| interval | number | 3.2 | Seconds each word stays up once it has settled. |
| speed | number | 15 | Cards a second each module turns through. A real board does about 15. |
| align | "left" | "center" | "left" | Where a short word sits on the board. |
| cards | string | " ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.,:-'!?&/" | The cards on each module, in the order they turn. Add lowercase letters to keep case. |
| tone | string | "" | The letters' colour, e.g. amber for an airport board. The text colour when unset. |
| sound | boolean | false | The clatter of the flaps. Plays only after a click. |
| interactive | boolean | true | A click turns the board to the next word. |
| className | string | – | Class on the board. It takes its size from font-size. |
| style | CSSProperties | – | Style on the board. Theme it through the --mlui-* variables. |