Component packs › Cogwork › Ratchet Slider

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.

Ratchet Slider props

PropTypeDefaultDescription
valuenumber
minnumber
maxnumber
stepsnumberNumber of teeth (steps) along the rack.
unitstring
labelstring
disabledboolean
onChange(value: number) => void
theme'light' | 'dark'
autoplaynumber | falseShowcase mode: ratchets up, then lifts the pawl and runs back, every N ms while visible.

Methods on the ref

Use it in React

import RatchetSlider from './RatchetSlider';

<RatchetSlider />

The Vue, HTML, Next.js, Tailwind and Motion versions take the same options.

More in Cogwork

Good for: Skeuomorphic UI.