Default
Examples of styling, gearing, detents, inertia and controlled state.
Basic
The four parts with Tailwind classes. One lap is one minute; a detent every five seconds.
1:12 / 3:47
Theme installation
The following examples use the shadcn theme. Add it to a project configured for shadcn before copying the examples.
pnpm dlx shadcn@latest add https://click-wheel.jackymo.me/r/click-wheel-shadcn.jsonGearing
unitsPerTurn sets the value change per revolution. A smaller value gives finer control without changing min or max.
1:12
Detents
detent sets the units between clicks. Each crossing fires onTick, which here plays a short blip. Haptics pulse once per update that crosses a detent.
Inertia
Enable inertia to keep the wheel spinning after release. Touching the ring resumes dragging; scroll and keyboard input stop coasting. data-coasting marks this state, and onValueCommitted fires when it settles. decelerationRate controls the slowdown: lower values stop sooner.
Controlled
Own the value with value and onValueChange. onInteractionChange tells you when the wheel owns the position, including scroll, keyboard and coasting. Freeze playback-driven readout updates while active, then seek the audio in onValueCommitted. Audio can keep playing throughout.
1:12 · paused