Skip to content

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.

PropTypeDefault
className

Classes for the trigger (e.g. a width, instead of the default full width).

string—
clearable

Offers a clear option in the popup (shown when a value is set); clearing reports null.

booleanfalse
clearLabel
string—
defaultValue

The first date, when the picker keeps its own.

string | nullnull
isDisabled

Dates that can't be picked, e.g. weekends or booked days.

((date: string) => boolean)—
locale

Decides the date format, month and weekday names, and the first day of the week, e.g. "en-IN". Defaults to the LocaleProvider's.

string—
max

Latest date that can be picked.

string—
min

Earliest date that can be picked ("YYYY-MM-DD").

string—
name

Form 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—
size

Height, 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—
weekStartsOn

0 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).

PropTypeDefault
className

Classes for the trigger (e.g. a width, instead of the default full width).

string—
clearable

Offers a clear option in the popup (shown when a value is set); clearing reports null.

booleanfalse
clearLabel
string—
defaultValue

The first range, when the picker keeps its own.

DateRange | nullnull
isDisabled

Dates that can't be picked, e.g. weekends or booked days.

((date: string) => boolean)—
locale

Decides the date format, month and weekday names, and the first day of the week, e.g. "en-IN". Defaults to the LocaleProvider's.

string—
max

Latest date that can be picked.

string—
min

Earliest date that can be picked ("YYYY-MM-DD").

string—
months

Months shown side by side (2 suits wide screens).

number1
name

Form 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—
presets

Ranges picked in one tap, beside the calendar.

DateRangePreset[]—
size

Height, matching Button's: sm (32px), default (40px) or lg (44px).

"default" | "lg" | "sm"—
value

The range when you keep it; end is null while only the start is picked.

DateRange | null—
weekStartsOn

0 for Sunday … 6 for Saturday. Defaults to the locale's.

number—