Skip to content

Date Picker

Get Ritla UI

Dates are typed when people know them (a birthday, a document), picked from a calendar when they browse for a day, ranges come with presets, and time has its own input. In Arabic the fields and the grid mirror, and the week starts from the locale.

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 date-picker

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

  2. Dependencies it brings

    @base-ui/react@phosphor-icons/reactreact-day-picker

  3. 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

date-picker.tsx
import { DateInput } from "@/components/ui/date-picker";const [date, setDate] = useState<Date | null>(null); <DateInput label="Transfer date" value={date} onValueChange={setDate} />

Examples

A date people know

A date of birth is typed, not browsed: picker={false} removes the calendar button, and showAge shows the age so people can check the year. The segments follow the region's order (day first in Arabic) and accept Arabic-Indic digits when typed.

EnglishMirroredArabic
LTR →

Time

TimeInput: hour and minute, then AM / PM, and the time zone when it matters. The clock keeps its order in Arabic: hour, then minute, from the left.

EnglishMirroredArabic
LTR →

A range with presets

DateRangePicker: the presets people actually use, two months on desktop and one on phones, and the chosen range written out in the field ("March 1 – 15, 2026").

EnglishMirroredArabic
LTR →

Date picker menu

DatePickerMenu on its own: the month and year buttons open their lists, then Cancel and Apply. Put it in a Popover, a Dialog or a Drawer as the screen needs.

EnglishMirroredArabic
LTR →

API reference

DateInput

PropTypeDefaultDescription
value / onValueChangeDate | null / (value: Date | null) => voidNoneA complete date, or null while it is empty or not real (31 February is not a date).
label / required / helperText / errorReactNode / booleanNoneAs in Input. Say the format in the helper text when it could be misread.
showAgebooleanfalseFigma's age badge, for a date of birth.
pickerbooleantrueThe calendar button that opens the Date picker menu.
min / maxDateNoneThe first and last dates the menu offers.
order("day" | "month" | "year")[]NoneDefault: the region's order. Day first in Arabic, month first in en-US.
disabled / readOnlybooleanNoneFigma's State.

TimeInput

PropTypeDefaultDescription
value / onValueChange{ hours, minutes } | nullNoneHours from 0 to 23.
hourCycle"h12" | "h23""h12"12 hours with AM / PM, or 24 hours.
timeZoneReactNodeNoneThe time zone at the end of the field when it matters ("UTC +03:00").

DatePicker / DatePickerMenu

PropTypeDefaultDescription
trigger (DatePicker)ReactElementNoneThe control that opens the menu in a Popover.
value / onApply / onCancel (Menu)Date / (value: Date) => void / () => voidNoneThe day the menu opens on, and Apply and Cancel.
fromYear / toYear (Menu)numberNoneThe year list's range.

DateRangePicker / DateRangeMenu

PropTypeDefaultDescription
value / onValueChangeDateRangeNoneThe range { from, to }.
presets{ label, range }[]NoneDefault: Figma's eight. Today, Yesterday, This week, Last week, This month, Last month, This year, Last year.
numberOfMonths (Menu)1 | 22Two months on desktop, one on phones.

Usage guidelines

Date pickers enter a date, a range or a time. Which control to pick, how formats work, how ranges and limits behave, what Arabic readers expect from a calendar, and the checks before handoff.

1. Which date control

Match the control to how people know the date. If they know it by heart or have it on a document, they type it. If they are browsing for a free day, they need a calendar. Ranges need presets. Times have their own input.

You need toUseWhy
Enter a known date: birth, ID expiry, a document dateDate inputTyping day, month and year beats paging through a calendar.
Choose a day while browsing: a booking, a deliveryDate input with the Date picker menuThe calendar shows weekdays and what is available.
Choose a range: reports, filters, staysDate range menuPresets for common ranges, two months on desktop.
Enter a time, with a timezone when it mattersTime inputSegments for time, AM or PM, and the zone.
Pick a nearby date or time on mobileDate picker modal or Wheel pickerLarge targets in a sheet or dialog.

Type what people already know

A date of birth at sign-up.

Do: Date inputThree quick segments; the age badge confirms the year.
Don't: A calendar for a birthdayPeople page back through thirty years of months.

2. Formats

The Date input orders day, month and year the way the region writes them, which for Arabic and most of the world is day first. Say the format in the helper text when it could be misread: 03-04 is March in some places and April in others. When displaying a date, write the month as a word, as in 3 April 2026. In code, formats come from Intl for the page language.

Do

  • Order segments by region; day first for Arabic.
  • Show the format in the helper text when it is ambiguous.
  • Write the month as a word when displaying dates.
  • Accept typed Arabic-Indic digits.

Don't

  • Use a US-only order (month first) for an Arabic or regional audience.
  • Show dates as 03/04/26 in lists and receipts.
  • Mix digit systems within one date.

3. Ranges and presets

Most ranges people choose are standard: last 7 days, this month, last quarter. Offer those as presets and let the calendar handle the rest. Show the chosen range in words above the calendar, and let people pick the end before the start without an error.

Do

  • Offer the presets your users actually use.
  • Show two months on desktop, one on mobile.
  • Show the selected range as text: 1 to 15 March 2026.
  • Swap the ends quietly when the end is before the start.

Don't

  • Force people to click two days for “last 7 days”.
  • Show an error when people pick the end date first.
  • Hide the range once the menu closes.

4. Limits and unavailable days

Disable days people can't choose: past days for a delivery, fully booked days for an appointment. Say why somewhere visible, in the helper or a legend, and open the calendar on the first available day.

Do

  • Disable days that can't be chosen, and say why.
  • Open on the first available month, not an empty one.
  • Set sensible min and max dates: no birth dates in the future.

Don't

  • Let people pick a day, then reject it after submit.
  • Disable days without any explanation.

5. Arabic calendars

Arabic readers expect more than a mirrored grid. The RTL variants mirror the layout, so the first day of the week is on the right, and the arrow pointing right means previous. The week starts on Saturday in the RTL variants; follow your market's locale in code. Month names differ by region: the Levant writes كانون الثاني where Egypt and the Gulf write يناير. Use one set across the product. If you show Hijri dates, label the calendar and never mix Hijri and Gregorian in one field.

The grid reads right to left

Choosing a day in Arabic.

Do: RTL variantThe week starts on the right and the arrows follow the Arabic reading order.
Don't: Left-to-right grid on an Arabic screenWeekdays run the wrong way for the Arabic reader, and the month starts on the left.

Before handoff

  • Typing for known dates, a calendar for browsing, presets for ranges.
  • Format, min and max dates, and unavailable days are noted.
  • The locale, first day of the week and month-name set are decided.
  • Arabic screens use RTL variants; Hijri dates are labeled.

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 segment to the next, then the calendar button.
ArrowUpArrowDownSteps the segment up or down; on AM / PM, switches it.
BackspaceIn an empty segment, goes back to the previous one.
EnterOn the calendar button, opens the menu; in the grid, chooses the day (see Calendar).
EscapeCloses the menu without a change.

ARIA

  • The field is a group named by its label, and each segment a numeric field with its name ("Day", "Month", "Year").
  • Typing is always the accessible way in; never make the calendar the only one.
  • AM / PM is a spinbutton that reads its value. The age badge reads "Age 34".
  • The calendar, month and year buttons are named in the page language, and the month and year lists are listboxes.

Do

  • Always offer typing as an alternative to the calendar.
  • Arrows move by day and week (in Arabic, ArrowLeft is the next day); Page Up and Page Down move by month, and the month is announced.
  • Name each day in full: “Tuesday 3 March 2026, available”.

Don't

  • The calendar as the only way.
  • Mark unavailable days by color alone.

Arabic and RTL notes

Mirrors

  • The date segments: the day on the right, then the month, then the year on the left; the calendar button and the age badge on the left.
  • The presets at the menu's inline start (the right), and Apply at the end of the buttons.

Does not mirror

  • The clock: hour, then minute, from the left, as on a clock.
  • Each segment's digits, and the UTC time zone.
Numerals
Segments, the grid and the age badge follow numerals, and typing accepts both systems.
Arabic typography
Segments are label-16, the month and year buttons body-16 Semibold.
Mixed-direction text
Never mix Hijri and Gregorian in one field: Hijri has its own picker.

Do

  • The RTL variants: the first day of the week on the right, and previous is the arrow pointing right.
  • The first day of the week from the market's locale.
  • One set of Arabic month names across the product.
  • Label Hijri dates, or show both calendars side by side.

Don't

  • The English grid on an Arabic screen.
  • Mix Levantine and Egyptian month names.
  • A Hijri date in a field read as Gregorian.