Skip to content
Alea0.1
Pro
  1. Alea
  2. Components
  3. Forms
  4. WheelPicker

Forms

WheelPicker

Scrolling wheels to pick from, like a phone picker: one or several columns, looping columns for hours and minutes, five or more visible rows. Swipe, scroll, click a row or use the arrow keys.

import { WheelPicker } from '@alea/ui';

Examples

WheelPicker

Scrolling wheels like a phone's picker: one or several columns. Swipe or scroll and the middle row is the pick; click a row; or focus a column and use the arrow keys.

1 × Navy, size M

Anatomy

The parts of the component and the class that styles each one.

Tokens

The design tokens this component reads, with their value in the current theme. Override any of them to restyle it.

Color

  • --alea-border…
  • --alea-surface-deep…
  • --alea-surface-raised…

Space

  • --alea-space-1…
  • --alea-space-2…

Radius

  • --alea-radius-lg…
  • --alea-radius-sm…

Component

  • --alea-wheel-row…

Props

WheelPicker props

Scrolling wheels to pick from, like a phone's picker: one or several columns (hours and minutes, size and color). Swipe, scroll, click a row, or use the arrow keys.

PropTypeDefaultDescription
columnsrequiredWheelColumn<string | number>[]-One or more columns side by side.
aria-labelstring-Name of the whole picker.
classNamestring-Extra class names.
defaultValueRecord<string, string | number>-The picked values at first. Default the first item of each column.
onChange((value: Record<string, string | number>) => void)-Called with every column's value when one changes.
rowHeightnumberROWRow height in px. Default 40 (44 on touch screens).
valueRecord<string, string | number>-The picked value of each column, by column id (controlled).
visibleRowsnumber5How many rows show. Odd numbers center the pick. Default 5.

Specs

Generated from the source: the variants in the types, the states and tokens in the CSS, and the motion patterns that apply. The grids render the real component in both themes; the numbers are measured from the page.

Dark and light
Every color comes from theme tokens, so it follows data-theme (and presets like Graphite) on the page or any wrapper. Contrast is checked in both themes.
Styling hooks
.alea-wheel.alea-wheel-band

Accessibility

  • Each column is a spinbutton named by its label, with the picked value as its text.
  • The scrolling wheel is a pointer convenience; the keyboard and screen readers use the spinbutton.
  • Rows are at least 44 px on touch screens.

Keyboard

KeyDoes
Arrow Up / DownPrevious or next value
Page Up / DownFive values
Home / EndFirst or last value
TabNext column

Do and don't

Do

  • Use it on touch screens for short lists (sizes, quantities, times).

Don't

  • Don't use it for long lists: use Select with search.
Tested with axe, keyboard and screen reader roles