crucıble

Throw

Slide-to-commit track and swipe-action rows. Throw: drag the knob (or arrow to 100% and press Enter) past the threshold and it snaps home, floods the track and turns into a check; the label shimmers and fades as the knob passes, early releases spring back. ThrowRow: swipe a list row to reveal leading/trailing actions with rubber-banding and scale-in icons; a full swipe past 60% fires the primary and the row collapses on a height spring. Slider semantics, arrow-key reveal, ref handles; tweens only under reduced motion.

motionfree

Installation

CLI

npx shadcn@latest add @crucible/throw

Manual — install dependencies, then copy the source

npm install motion

Props

PropTypeDefaultDescription
labelstring"Slide to confirm"Instruction text inside the track; also the slider's accessible name.
committedLabelstring"Done"Text shown in the filled track once committed.
onCommit() => voidFires once when the knob is thrown past the threshold (or Enter is pressed at the end).
thresholdnumber0.85Fraction of the travel (0–1) the knob must pass on release to commit.
accentColorstring"#f5f5f5"Fill colour behind the knob and of the committed track. Any CSS colour; hex gets auto-contrast ink.
disabledbooleanfalseDisable dragging and keys.
hintbooleantrueIdle hint — the knob nudges forward every few seconds until first touched.
pausedbooleanfalseFreeze the shimmer and idle hint.
classNamestring
refReact.Ref<ThrowHandle>Imperative handle — { reset(), focus() }.

Honors prefers-reduced-motion with a designed static fallback, and passes className through.