Wheel Picker
betaA drum of options you spin to pick one: rows turn on a cylinder and snap into a selection band, like a phone's time picker.
- Forms
- 1 file
- 1 npm package
- Accessibility notes
Loading the example…
pnpm dlx @dowel-ui/cli add wheel-pickernpm packages installed: class-variance-authority.
import { WheelPicker } from "@/components/ui/wheel-picker";Default
Time
Small
<WheelPicker>
| Prop | Type | Default |
|---|---|---|
options (required) | WheelPickerOption[] | — |
defaultValueInitial value when uncontrolled; the first enabled option otherwise. | string | — |
disabled | boolean | false |
nameSubmits the selected value under this name in a surrounding form. | string | — |
onValueChangeCalled when the drum settles on a different option. | (value: string) => void | — |
size | "sm" | "md" | "md" |
valueControlled selected value. | string | — |
visibleCountRows in view, odd so one sits in the middle. Default 5. | number | 5 |
Plus every attribute of <div> except defaultValue, onChange.
A role="listbox" that keeps focus on itself and points aria-activedescendant at the centred option, which is also aria-selected. Arrow keys move one row, Page Up/Down a screenful, Home/End to the ends, and typing jumps to the next option starting with those letters; disabled options are skipped. Name it with aria-label or aria-labelledby. Selection commits when the drum settles, so a fling does not announce every row it passes. The turning rows are decoration; under reduced motion scrolling jumps instead of gliding.
9/9
checks passed
- Tested — passes
- axe assertion — passes
- Keyboard tested — passes
- Storybook examples — passes
- Accessibility documented — passes
- Semantic tokens only — passes
- Motion from tokens — does not apply
- className merged — passes
- Visible focus — passes
- No fixed widths — passes