Date Picker
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.
Installation
Add the component
npx ritla add date-pickerAlso works with shadcn:
npx shadcn@latest add @ritla/date-pickerDependencies it brings
@base-ui/react@phosphor-icons/reactreact-day-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 { 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.
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.
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").
API reference
DateInput
| Prop | Type | Default | Description |
|---|---|---|---|
value / onValueChange | Date | null / (value: Date | null) => void | None | A complete date, or null while it is empty or not real (31 February is not a date). |
label / required / helperText / error | ReactNode / boolean | None | As in Input. Say the format in the helper text when it could be misread. |
showAge | boolean | false | Figma's age badge, for a date of birth. |
picker | boolean | true | The calendar button that opens the Date picker menu. |
min / max | Date | None | The first and last dates the menu offers. |
order | ("day" | "month" | "year")[] | None | Default: the region's order. Day first in Arabic, month first in en-US. |
disabled / readOnly | boolean | None | Figma's State. |
TimeInput
| Prop | Type | Default | Description |
|---|---|---|---|
value / onValueChange | { hours, minutes } | null | None | Hours from 0 to 23. |
hourCycle | "h12" | "h23" | "h12" | 12 hours with AM / PM, or 24 hours. |
timeZone | ReactNode | None | The time zone at the end of the field when it matters ("UTC +03:00"). |
DatePicker / DatePickerMenu
| Prop | Type | Default | Description |
|---|---|---|---|
trigger (DatePicker) | ReactElement | None | The control that opens the menu in a Popover. |
value / onApply / onCancel (Menu) | Date / (value: Date) => void / () => void | None | The day the menu opens on, and Apply and Cancel. |
fromYear / toYear (Menu) | number | None | The year list's range. |
DateRangePicker / DateRangeMenu
| Prop | Type | Default | Description |
|---|---|---|---|
value / onValueChange | DateRange | None | The range { from, to }. |
presets | { label, range }[] | None | Default: Figma's eight. Today, Yesterday, This week, Last week, This month, Last month, This year, Last year. |
numberOfMonths (Menu) | 1 | 2 | 2 | Two 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 to | Use | Why |
|---|---|---|
| Enter a known date: birth, ID expiry, a document date | Date input | Typing day, month and year beats paging through a calendar. |
| Choose a day while browsing: a booking, a delivery | Date input with the Date picker menu | The calendar shows weekdays and what is available. |
| Choose a range: reports, filters, stays | Date range menu | Presets for common ranges, two months on desktop. |
| Enter a time, with a timezone when it matters | Time input | Segments for time, AM or PM, and the zone. |
| Pick a nearby date or time on mobile | Date picker modal or Wheel picker | Large targets in a sheet or dialog. |
Type what people already know
A date of birth at sign-up.
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.
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.
| Key | Action |
|---|---|
| Tab | From one segment to the next, then the calendar button. |
| ArrowUpArrowDown | Steps the segment up or down; on AM / PM, switches it. |
| Backspace | In an empty segment, goes back to the previous one. |
| Enter | On the calendar button, opens the menu; in the grid, chooses the day (see Calendar). |
| Escape | Closes 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 buttonsbody-16Semibold. - 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.