Letters that topple like dominoes and rebuild
| Name | Type | Default | Description |
|---|---|---|---|
text | string | "One good move" | Text to display. Words wrap as whole units and whitespace is preserved. |
as | "span" | "div" | "p" | "h1" | … | "h6" | "span" | Element to render. The component inherits font, size and alignment from its parent. |
color | string | "currentColor" | Colour of the letters. Defaults to the surrounding text colour. |
fall | "side" | "back" | "side" | How letters tip over: sideways in the plane, pivoting on a bottom corner like dominoes, or backwards away from the viewer, folding flat onto the baseline. |
direction | "right" | "left" | "right" | Which way the intro chain runs, and the way the whole line falls when toppled from code. |
intro | boolean | true | Letters start lying down and spring upright one after another, fading in as they rise. |
trigger | "view" | "mount" | "view" | When the intro plays: the first time the text scrolls into view, or as soon as it mounts. |
delay | number | 0.2 | Seconds before the first letter rises. |
stagger | number | 0.03 | Extra seconds between one letter rising and the next. |
gravity | number | 1 | How quickly toppled letters fall. Higher values make the chain run faster. |
lean | number | 58 | Angle, in degrees, at which a toppled letter comes to rest against the next one. The last letter in a line lies flat. |
stiffness | number | 1 | Stiffness of the spring that stands letters back up. |
damping | number | 0.55 | Damping of that spring. Lower values rock back and forth more before settling upright. |
hold | number | 1.2 | Seconds toppled letters stay down before the line rebuilds. 30 or more leaves them down. |
push | number | 1 | How strongly the pointer nudges the letters it passes. Faster movement pushes harder. 0 turns it off. |
toppleAt | number | 30 | Tilt, in degrees, past which a nudged letter falls over and starts a chain. 90 means the pointer never topples letters. |
chain | boolean | true | Falling letters knock over their neighbours, like dominoes. |
clickTopple | boolean | true | Clicking knocks the line down outward from the clicked letter. |
shade | number | 0.6 | How much tilted letters dim, from 0 to 1. |
loop | boolean | false | Topple and rebuild the line on its own every loopDelay seconds. |
loopDelay | number | 8 | Seconds between automatic topples when looping. |
area | "parent" | "self" | "parent" | Where the pointer is followed: anywhere over the parent element, or only over the text. |
paused | boolean | false | Shows the text upright and still. Reduced-motion users always get this. |
ref | { rise, topple } | — | Imperative controls: replay the intro, or knock the whole line over from its start. |
className | string | — | Classes for the root element, for example font size and weight. |
style | CSSProperties | — | Inline styles for the root element. |
textstringText to display. Words wrap as whole units and whitespace is preserved.
"One good move"as"span" | "div" | "p" | "h1" | … | "h6"Element to render. The component inherits font, size and alignment from its parent.
"span"colorstringColour of the letters. Defaults to the surrounding text colour.
"currentColor"fall"side" | "back"How letters tip over: sideways in the plane, pivoting on a bottom corner like dominoes, or backwards away from the viewer, folding flat onto the baseline.
"side"direction"right" | "left"Which way the intro chain runs, and the way the whole line falls when toppled from code.
"right"introbooleanLetters start lying down and spring upright one after another, fading in as they rise.
truetrigger"view" | "mount"When the intro plays: the first time the text scrolls into view, or as soon as it mounts.
"view"delaynumberSeconds before the first letter rises.
0.2staggernumberExtra seconds between one letter rising and the next.
0.03gravitynumberHow quickly toppled letters fall. Higher values make the chain run faster.
1leannumberAngle, in degrees, at which a toppled letter comes to rest against the next one. The last letter in a line lies flat.
58stiffnessnumberStiffness of the spring that stands letters back up.
1dampingnumberDamping of that spring. Lower values rock back and forth more before settling upright.
0.55holdnumberSeconds toppled letters stay down before the line rebuilds. 30 or more leaves them down.
1.2pushnumberHow strongly the pointer nudges the letters it passes. Faster movement pushes harder. 0 turns it off.
1toppleAtnumberTilt, in degrees, past which a nudged letter falls over and starts a chain. 90 means the pointer never topples letters.
30chainbooleanFalling letters knock over their neighbours, like dominoes.
trueclickTopplebooleanClicking knocks the line down outward from the clicked letter.
trueshadenumberHow much tilted letters dim, from 0 to 1.
0.6loopbooleanTopple and rebuild the line on its own every loopDelay seconds.
falseloopDelaynumberSeconds between automatic topples when looping.
8area"parent" | "self"Where the pointer is followed: anywhere over the parent element, or only over the text.
"parent"pausedbooleanShows the text upright and still. Reduced-motion users always get this.
falseref{ rise, topple }Imperative controls: replay the intro, or knock the whole line over from its start.
—classNamestringClasses for the root element, for example font size and weight.
—styleCSSPropertiesInline styles for the root element.
—