Skip to content

Wheel Picker

Get Ritla UI

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.

PreviewCode
EnglishMirroredArabic
LTR →

Installation

  1. Add the component

    npx ritla add wheel-picker

    Also works with shadcn: npx shadcn@latest add @ritla/wheel-picker

  2. Or 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

wheel-picker.tsx
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.

EnglishMirroredArabic
LTR →

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.

EnglishMirroredArabic
LTR →

API reference

WheelDateTimePicker

PropTypeDefaultDescription
value / onValueChangeDate / (value: Date) => voidNoneThe value, always a full date and time. Open on a sensible one: today, the next full five minutes.
min / maxDatetoday / 60 days laterThe first and last day offered. Limit them to what is valid, such as no past days for a delivery.
minuteStepnumber5Minutes 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 }NoneNames for the group and columns, for screen readers. Default: in the page language; repeat the field's label in group.
locale / numeralsstring / "latn" | "arab"NoneDefault: from RitlaProvider. Names come from Intl in the page language, and every column uses one digit system.

WheelDatePicker

PropTypeDefaultDescription
value / onValueChangeDate / (value: Date) => voidNoneA day past the end of the new month moves to its last day (31 May, then June: 30 June).
minYear / maxYearnumbervalue ± 5The years offered.
labels{ group, day, month, year }NoneNames for the group and columns.

WheelPicker / WheelPickerColumn

PropTypeDefaultDescription
options{ value, label, valueText?, disabled? }[]NoneThe column's rows. valueText is what a screen reader says; disabled rows stay visible and the column skips them (a booked slot).
value / onValueChangestring / (value: string) => voidNoneThe value of the row in the band.
labelstringNoneThe column's name ("Hour").
aria-label (WheelPicker)stringNoneThe 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 toUseWhy
Pick a time, or a date and time close to now, on mobileWheel picker, Date and timeSmall adjustments with the thumb, in a bottom sheet.
Pick a date within a few weeks, on mobileWheel picker, DateDay and month are a flick away.
Enter a birthday or another date far from todayInput field with a date formatTyping 1990 beats scrolling through thirty years.
Pick a date or a range on desktopDate pickerA 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.

Do: RTL variantThe day is on the right, where the Arabic reader starts; day names, month names and ص and م are Arabic.
Don't: Left-to-right layout on an Arabic screenThe columns run the wrong way for the Arabic reader.

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.

KeyAction
TabFrom one column to the next: in the date and time picker, day, hour, minute, then AM / PM.
ArrowUpArrowDownOne row up or down in the column.
PageUpPageDownFive rows.
HomeEndThe first and last row.

ARIA

  • Each column is a spinbutton with its name and its value in words in aria-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 spinbutton with 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-24 Semibold, 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 «م».