crucıble

Scree

A paragraph that holds its typographic line until triggered, then every word becomes a matter-js rigid body that drops, tumbles, collides, and piles at the floor — grab a fallen word and fling it. Highlight words carry the lone accent and settle atop the neutral heap.

canvaspro

Installation

CLI

npx shadcn@latest add @crucible/scree

Manual — install dependencies, then copy the source

npm install matter-js

Props

PropTypeDefaultDescription
textstringa short lineThe body text. Every word becomes a falling rigid body.
highlightWordsstring[][]Words rendered in the accent color — they settle atop the neutral pile. Matched case-insensitively, ignoring surrounding punctuation.
accentstringwarm amberThe single accent hue reserved for {@link highlightWords}.
wordColorstringnear-whiteColor of the ordinary words.
triggerScreeTrigger"hover"What fires the collapse.
gravitynumber1Gravity strength — higher drops faster/heavier.
speednumber1Simulation-rate multiplier (matter timeScale).
restitutionnumber0.24Bounciness of the words (0 = dead, ~0.6 = lively).
mouseStiffnessnumber0.2Grab strength of the pointer constraint when flinging a word.
fontSizenumber22Word font size in px.
wordSpacingnumber6Extra horizontal/vertical spacing between words in px.
resetOnLeavebooleantrueFor the hover and scroll triggers: rebuild the paragraph when the pointer leaves / the block scrolls away, so the effect replays.
pausedbooleanfalseFreeze the simulation in place.
seednumber7Deterministic seed for tumble bias + the settling shuffle.
Also accepts all props of Omit<React.ComponentPropsWithoutRef<"div">, "children" | "color">they pass through to the underlying element.

Honors prefers-reduced-motion with a designed static fallback, pauses offscreen and on hidden tabs, and passes className through.