Skip to content
English
Wheel picker comes with Pro. Its preview shows once you unlock it.

How it works

The wheel's position is one number in rows, --_p, written to the root's style on animation frames; every word works out its distance d from it in CSS. In the arc shape the start of a word is carried by −d × the step angle round a hub to the right of the words (the step is the row height divided by the radius), so the list curves like the edge of a dial, and the word itself tilts by only 45% of that angle, so long words do not lean into the next row; in the drum shape it turns round an axis behind the words with rotateX. Opacity falls with |d| to nothing just past the rows in view, and blur grows past the centre row. A drag follows the finger one row per row height with growing resistance past the ends. On release the speed over the last 90ms projects where a coast would stop; the wheel then approaches that whole row exponentially (time constant 0.26s), so it arrives quickly and settles softly on the detent. Scrolling turns it directly and settles when scrolling pauses. A press on a word turns the wheel to it, and with multiple ticks it. React renders only when the centred word changes, which also ticks a small accent mark in the centre band.

Use it for

  • Choosing from a list that is long but well known: treatments, genres, cuisines, times, quantities.
  • Mobile sheets and booking flows, where a thumb flick is faster than scrolling a long list.
  • Filters where several words can be ticked without leaving the wheel.

Look elsewhere when

  • Lists people need to search or compare: use a select or a multi-select with search.
  • Fewer than five options: show them all as chips or radios.

Usage

import { useState } from 'react'
import { WheelPicker } from './WheelPicker.jsx'

const treatments = ['Massage', 'Facial', 'Sauna', 'Steam room', 'Hot stones', 'Reflexology']

export function TreatmentPicker() {
  const [picked, setPicked] = useState(['Facial'])
  return <WheelPicker label="Treatments" items={treatments} multiple value={picked} onChange={setPicked} />
}

export function TimePicker({ slots }) {
  const [time, setTime] = useState(slots[0])
  return <WheelPicker label="Start time" items={slots} value={time} onChange={setTime} shape="drum" />
}

Props

PropTypeDefaultWhat it does
items(string | { value, label, disabled? })[]—The words in order. Plain strings are their own value.
multiplebooleanfalseSeveral choices: pressing a word, or Space on the centred one, ticks it. Off, the word the wheel rests on is the value.
value / defaultValue / onChangevalue | value[] / … / (next, changed) => void- / first item or [] / -Single choice: the value of the chosen word, set when the wheel comes to rest; setting it from outside turns the wheel there. Multiple: the ticked values, in list order.
onActiveChange(value, index) => void—Fires each time another word passes the centre, while the wheel is still moving.
defaultActivenumber0With multiple, the index of the word centred at first.
shape'arc' | 'drum''arc'arc: the words follow the edge of a large dial whose hub is to their right, each tilted along the curve. drum: they wrap round a cylinder and turn in depth.
rows / itemHeight / radiusnumber / number / number5 / 36 / by shapeRows in view, the height of one row in px, and the dial's or drum's radius in px (6.5 or 2.9 rows by default).
blurbooleantrueBlurs words with their distance from the centre. Off, they only fade.
labelstring—Accessible name of the list.
disabledbooleanfalseFades the wheel and ignores input.
...restHTMLAttributes—Other attributes go to the root <div>.

Accessibility

  • The wheel is a listbox (aria-multiselectable with multiple) named by label; every word is an option with aria-selected, and aria-activedescendant follows the centred word.
  • Up and Down move one word, PageUp and PageDown a wheel's height, Home and End the ends; with multiple, Space or Enter ticks the centred word. Focus lights the centre band with a ring.
  • Ticked words show a filled check as well as darker text, so the choice is not carried by colour alone.
  • Touch: touch-action keeps sideways page gestures but gives vertical drags to the wheel; any word in view can be pressed directly.
  • Reduced motion drops the coast: the wheel follows a drag and then jumps to the nearest word, and keys and presses move it at once.

Motion

Coast after a flick: exponential approach with a 0.26s time constant to the projected row. Keys and presses: 0.10 to 0.15s time constant. Release without speed or end of scrolling: 0.10 to 0.12s. Centre mark: a 160ms tick on every word that passes. Tick: background fills over --ds-duration-fast and the circle pops on --ds-ease-spring.

Add it to your project

Pro members copy a prompt and their coding agent installs the source, the same way as the free components.

WheelPicker.jsxwheel-picker.csstokens.cssREADME.md

Both files install together. The stylesheet reads the design tokens in tokens.css and carries fallbacks, so it also works alone.

Form inputs
Availability grid comes with Pro. Its preview shows once you unlock it.
Boolean operations comes with Pro. Its preview shows once you unlock it.
Cascader comes with Pro. Its preview shows once you unlock it.