Wheel Picker
People choose a date or a time by scrolling columns, the usual pattern on phones for a time or a nearby date. In Arabic the day sits on the right and ص / م on the left, while hour and minute keep clock order; days and months carry their Arabic names.
Preview
Mirrored is the same English content laid out right to left: it separates a mirroring bug from a translation one.
Installation
Add the component
npx ritla add wheel-pickerAlso works with shadcn:
npx shadcn@latest add @ritla/wheel-pickerOr copy by hand
Installing by hand copies the component's source into your project. The source comes with a Ritla UI license, so the CLI is the short way to the same files.
Usage
import { WheelDateTimePicker } from "@/components/ui/wheel-picker";const [value, setValue] = useState(() => nextFiveMinutes()); <WheelDateTimePicker value={value} onValueChange={setValue} minuteStep={5} />Examples
Date
WheelDatePicker: day, month and year, the day first in reading order. Months are short in English and written out in Arabic; years run five either side of the value by default (minYear, maxYear). For a birthday, type the date in a field rather than scroll through years.
In a bottom sheet, from a field
The field shows the value and opens a bottom sheet (Drawer) titled with the field's label. Done keeps the new value; Cancel, the close button or a swipe down leave it as it was. Don't leave a wheel open inline on a page.
API reference
WheelDateTimePicker
| Prop | Type | Default | Description |
|---|---|---|---|
value / onValueChange | Date / (value: Date) => void | None | The value, always a full date and time. Open on a sensible one: today, the next full five minutes. |
min / max | Date | today / 60 days later | The first and last day offered. Limit them to what is valid, such as no past days for a delivery. |
minuteStep | number | 5 | Minutes in steps of this. |
hourCycle | "h12" | "h23" | "h12" | 12 hours with the AM / PM column, or 24 hours without it. |
labels | { group, day, hour, minute, period } | None | Names for the group and columns, for screen readers. Default: in the page language; repeat the field's label in group. |
locale / numerals | string / "latn" | "arab" | None | Default: from RitlaProvider. Names come from Intl in the page language, and every column uses one digit system. |
WheelDatePicker
| Prop | Type | Default | Description |
|---|---|---|---|
value / onValueChange | Date / (value: Date) => void | None | A day past the end of the new month moves to its last day (31 May, then June: 30 June). |
minYear / maxYear | number | value ± 5 | The years offered. |
labels | { group, day, month, year } | None | Names for the group and columns. |
WheelPicker / WheelPickerColumn
| Prop | Type | Default | Description |
|---|---|---|---|
options | { value, label, valueText?, disabled? }[] | None | The column's rows. valueText is what a screen reader says; disabled rows stay visible and the column skips them (a booked slot). |
value / onValueChange | string / (value: string) => void | None | The value of the row in the band. |
label | string | None | The column's name ("Hour"). |
aria-label (WheelPicker) | string | None | The whole picker's name; repeat the field's label. |
Usage guidelines
A wheel picker picks a time or a near date on mobile. When it fits, its default and range, where it lives, and the checks before handoff.
1. When it fits
Use the wheel picker on mobile for a time, or a date within a few weeks of today: booking a slot, scheduling a transfer. For dates far away, like a birthday, scrolling through years is slow; offer typing. On desktop, use the calendar date picker.
| You need to | Use | Why |
|---|---|---|
| Pick a time, or a date and time close to now, on mobile | Wheel picker, Date and time | Small adjustments with the thumb, in a bottom sheet. |
| Pick a date within a few weeks, on mobile | Wheel picker, Date | Day and month are a flick away. |
| Enter a birthday or another date far from today | Input field with a date format | Typing 1990 beats scrolling through thirty years. |
| Pick a date or a range on desktop | Date picker | A calendar shows weekdays and context at a glance. |
2. Defaults and ranges
Open on the most likely value: today and the next free slot, never an empty or distant value. Limit the columns to what is valid: no past dates for a delivery, only opening hours for a booking. Minutes in steps of 5 are usually enough.
Do
- Open on a sensible default: today, the next full 5 minutes.
- Limit dates and times to the valid range.
- Show the chosen value in the field as soon as the sheet closes.
Don't
- Open on 1 January 2000 or midnight by default.
- Let people pick a time that is already taken, then reject it.
- Scroll minutes one by one when 5-minute steps would do.
3. Where it lives
The wheel picker opens in a bottom sheet from a field that shows the current value. The sheet has a title that repeats the field's label, and Done confirms. The field, not the wheel, is what stays on the page.
Do
- Open it from a field that shows the chosen value.
- Title the sheet with the field's label, and confirm with Done.
- Let people close the sheet without changing the value.
Don't
- Leave a wheel picker open inline on a page.
- Stack two wheel pickers on one screen; use one sheet with both columns.
4. Arabic
In the RTL variants the date column sits at the start (right) and AM/PM at the far left; hour and minute keep clock order, hour then minute left to right. Day and month names are in Arabic, and AM and PM become ص and م. Digits follow the numerals setting, the same in every column. Month names must match the date pickers and the rest of the product: pick one set of Arabic month names.
Date at the start, time in clock order
Scheduling a transfer in Arabic.
Before handoff
- Used on mobile for near dates and times only.
- Default value and valid range are noted.
- Opens in a bottom sheet from a field, with Done.
- Arabic screens use the RTL variant, one digit system and the product's month names.
Accessibility
Keyboard
Keys are written for left-to-right. In right-to-left the arrow keys swap: the one pointing toward the reading direction moves forward.
| Key | Action |
|---|---|
| Tab | From one column to the next: in the date and time picker, day, hour, minute, then AM / PM. |
| ArrowUpArrowDown | One row up or down in the column. |
| PageUpPageDown | Five rows. |
| HomeEnd | The first and last row. |
ARIA
- Each column is a
spinbuttonwith its name and its value in words inaria-valuetext("Wednesday 30 December"), never the band's color alone. - The columns are a group named after the field. The rows are the picture only, hidden from screen readers.
- Scrolling uses the platform's own momentum and settles by CSS scroll snapping; with reduced motion the column jumps instead of gliding.
- Scrolling is hard for some people: also let them type the value in the field.
Do
- Each column a
spinbuttonwith a readable value: “Wednesday 30 December”. - The up and down arrows change the focused column.
- A typed alternative in the field.
Don't
- Rely on the selection band's color alone.
- Hide the chosen value once the sheet closes.
Arabic and RTL notes
Mirrors
- The column order: the day on the right, where the Arabic reader starts, then the time, with ص / م on the left.
Does not mirror
- Scrolling is vertical: up and down don't change and the rows inside a column don't flip.
- Hour, then minute, left to right in every language, as on a clock; only AM / PM moves to the other side. Tab follows the pair: hour, then minute.
- Numerals
- Every column uses one digit system from
numerals: "6 25" or "٦ ٢٥", never both in one picker. - Arabic typography
- Rows are
numeric-24Semibold, 48px tall, with Arabic words in IBM Plex Sans Arabic; long Arabic names ("الأربعاء 30 ديسمبر") widen the column rather than wrap. - Mixed-direction text
- Arabic month names come from Intl (يناير to ديسمبر), the same set as the date pickers and the rest of the product.
Do
- The RTL variant on Arabic screens.
- One digit system in every column, from the numerals setting.
- The same Arabic month names as the date pickers.
Don't
- The English variant on an Arabic screen.
- Mix Arabic-Indic and Western digits in one picker.
- Translate AM and PM word by word; use «ص» and «م».