Component packs › Cogwork › Ratchet Slider
The carriage runs along a toothed rack; its pawl rides up each tooth and drops behind it, so it only goes back once you lift the pawl.
Ratchet Slider is a slider from Cogwork, a component pack with 6 clockwork controls: Controls run by real gears: they mesh, wind, tick and ratchet. Price: $2 for the whole pack.
Built with: pawl rides the teeth, one-way by design, lift to go back.
Code: React and Next.js (TypeScript), Vue 3, plain HTML/CSS/JS, Tailwind CSS v4 and Motion (motion.dev). No npm packages needed. Keyboard accessible, with a reduced-motion version, in dark and light.
| Prop | Type | Default | Description |
|---|---|---|---|
value | number | ||
min | number | ||
max | number | ||
steps | number | Number of teeth (steps) along the rack. | |
unit | string | ||
label | string | ||
disabled | boolean | ||
onChange | (value: number) => void | ||
theme | 'light' | 'dark' | ||
autoplay | number | false | Showcase mode: ratchets up, then lifts the pawl and runs back, every N ms while visible. |
readonly value: numberreadonly lifted: booleansetValue(value: number): voidsetLifted(lifted: boolean): voiddestroy(): voidimport RatchetSlider from './RatchetSlider';
<RatchetSlider />The Vue, HTML, Next.js, Tailwind and Motion versions take the same options.
Good for: Skeuomorphic UI.