Components
Date Picker
A field that opens a calendar: one date, or a range previewed as you point. Dates are "YYYY-MM-DD" strings, so they never shift with time zones.
Import
import { DatePicker, DateRangePicker } from '@rinzai/zen';Examples
Range
A trip: the start, then the end, across two months. Closes once both are picked.
Presets
The ranges people pick most, one tap each, beside the calendar.
In field
In a Field: the label, hint and error are wired to the picker. Only dates from today on.
When the plan begins.
API reference
<DatePicker>
Date field: shows the date ("Sep 30, 2026" for the locale) and opens a Calendar to pick one, focused on the chosen date so the keyboard works at once. Dates are "YYYY-MM-DD" strings. When clearable, the popup also offers clearLabel to empty it. With name, it's submitted with a form.
| Prop | Type | Default |
|---|---|---|
classNameClasses for the trigger (e.g. a width, instead of the default full width). | string | — |
clearableOffers a clear option in the popup (shown when a value is set); clearing reports null. | boolean | false |
clearLabel | string | — |
defaultValueThe first date, when the picker keeps its own. | string | null | null |
isDisabledDates that can't be picked, e.g. weekends or booked days. | ((date: string) => boolean) | — |
localeDecides the date format, month and weekday names, and the first day of the week, e.g. "en-IN". Defaults to the LocaleProvider's. | string | — |
maxLatest date that can be picked. | string | — |
minEarliest date that can be picked ("YYYY-MM-DD"). | string | — |
nameForm field name: the value is submitted with the form ("YYYY-MM-DD", a range as "start/end"). | string | — |
onValueChange | ((date: string | null) => void) | — |
placeholder | string | — |
sizeHeight, matching Button's: sm (32px), default (40px) or lg (44px). | "default" | "lg" | "sm" | — |
value"YYYY-MM-DD", or null for none, when you keep it. | string | null | — |
weekStartsOn0 for Sunday … 6 for Saturday. Defaults to the locale's. | number | — |
<DateRangePicker>
Date range field: pick a start and then an end in a Calendar (the days between are previewed while pointing); it closes once the range is complete. Shows the range the locale's way, e.g. "Sep 3 – 10, 2026". With presets, common ranges ("Last 30 days") sit beside the calendar, one tap each (see commonRanges).
| Prop | Type | Default |
|---|---|---|
classNameClasses for the trigger (e.g. a width, instead of the default full width). | string | — |
clearableOffers a clear option in the popup (shown when a value is set); clearing reports null. | boolean | false |
clearLabel | string | — |
defaultValueThe first range, when the picker keeps its own. | DateRange | null | null |
isDisabledDates that can't be picked, e.g. weekends or booked days. | ((date: string) => boolean) | — |
localeDecides the date format, month and weekday names, and the first day of the week, e.g. "en-IN". Defaults to the LocaleProvider's. | string | — |
maxLatest date that can be picked. | string | — |
minEarliest date that can be picked ("YYYY-MM-DD"). | string | — |
monthsMonths shown side by side (2 suits wide screens). | number | 1 |
nameForm field name: the value is submitted with the form ("YYYY-MM-DD", a range as "start/end"). | string | — |
onValueChange | ((range: DateRange | null) => void) | — |
placeholder | string | — |
presetsRanges picked in one tap, beside the calendar. | DateRangePreset[] | — |
sizeHeight, matching Button's: sm (32px), default (40px) or lg (44px). | "default" | "lg" | "sm" | — |
valueThe range when you keep it; | DateRange | null | — |
weekStartsOn0 for Sunday … 6 for Saturday. Defaults to the locale's. | number | — |