WheelPicker is the main component for creating iOS-style wheel picker interfaces. It supports both controlled and uncontrolled modes, infinite scrolling, keyboard navigation, and type-ahead search.
Props
Array of options to display in the wheel. Each option must have a
value and label property.Current value of the picker when controlled. Use with
onValueChange to create a controlled component.Initial value of the picker when uncontrolled. If not provided, the first enabled option will be selected.
Callback fired when the selected value changes. Receives the new value as an argument.
Whether the wheel should loop infinitely. When enabled, scrolling past the last item wraps to the first item and vice versa.
The number of options visible on the circular ring. Must be a multiple of 4. Higher values create a larger, less curved wheel.
Sensitivity of the drag interaction. Higher values make the wheel more sensitive to drag gestures, affecting deceleration speed.
Sensitivity of the scroll interaction. Higher values make scrolling with arrow keys and mouse wheel faster.
Height (in pixels) of each item in the picker list. Adjust this to make items larger or smaller.
Custom class names for styling different parts of the wheel picker.See WheelPickerClassNames for details.
Value Types
The generic typeT extends WheelPickerValue, which can be either string or number:
Keyboard Navigation
WheelPicker supports full keyboard navigation:
- Arrow Up/Down: Navigate between options
- Arrow Left/Right: Navigate between pickers in a
WheelPickerWrapper - Home: Jump to first option (non-infinite mode only)
- End: Jump to last option (non-infinite mode only)
- Type characters: Type-ahead search to quickly find options
Type-Ahead Search
The component includes built-in type-ahead search functionality. When the picker is focused, typing characters will search through options and select the first match. For options withReactNode labels, you can provide a custom textValue for search: