Date picker
A date or a period chosen on a calendar — ISO values (2026-10-11) the form, the address and the API share, read in the locale's own words through @krizaka/intl.
Web only — React, from @krizaka/ui/date-picker. Beta: its API may still change in a minor version.
When to use
- To schedule something on a day: a publication, an auction's end, a reminder.
- With
DateRangePickerfor a period: an earnings report, an audit log, a campaign — with presets. - With
Calendaralone when the month itself is the interface (availability, a booking).
When not to use
Installation
Install
npm install @krizaka/ui @krizaka/tailwind @krizaka/tokens tailwindcssStyles
@import "tailwindcss";
@import "@krizaka/tailwind";
@import "@krizaka/ui/tailwind.css";Import
import { DatePicker, DateRangePicker, Calendar } from "@krizaka/ui/date-picker";Examples
Schedule
A publication date, from today on, written the way the locale writes it.
Your followers are told when it goes live.
Calendar open
The popover open on the month: today marked, the chosen day filled.
Period with presets
DateRangePicker for an earnings report: presets beside the calendar.
In French
locale="fr-CA": the names, the order and the first day of the week follow.
Calendar alone
Calendar inline: the month is the interface, weekends unavailable.
October 2026
| Mon | Tue | Wed | Thu | Fri | Sat | Sun |
|---|---|---|---|---|---|---|
Props
Calendar
A month grid to pick a date or the ends of a range, with the full keyboard of the APG date picker.
| Prop | Type | Default | Description |
|---|---|---|---|
localerequired | string | — | The BCP 47 locale of the month and day names ("en-US", "fr-CA"): always explicit. |
autoFocus | boolean | — | Moves the focus to the active day when it mounts (inside a popover). |
className | string | — | Classes merged on the root. |
defaultMonth | string | — | The month shown at first. Default: the value's, or today's. |
isDateDisabled | ((date: string) => boolean) | — | Refuses some dates ((d) => isWeekend(d)). |
labels | Partial<CalendarLabels> | — | The words, passed translated; English by default. |
max | string | — | The latest date that can be picked. |
min | string | — | The earliest date that can be picked. |
month | string | — | The month shown, any day of it (controlled). |
onMonthChange | ((month: string) => void) | — | Called when the month shown changes. |
onSelect | ((date: string) => void) | — | Called with the day picked. |
range | DateRange | null | — | The chosen range (range mode): its ends are marked, the days between tinted. |
today | string | — | Today (marked): inject it for a stable server render or a test. Default: the device's date. |
value | string | null | — | The chosen date (one-date mode). |
weekStartsOn | number | — | The first day of the week, 0 = Sunday. Default: the locale's. |
DatePicker
A date field: a button showing the date in the locale's format, a calendar in a popover, an ISO value.
| Prop | Type | Default | Description |
|---|---|---|---|
labelrequired | string | — | The visible label, passed translated (also the button's accessible name, with the value). |
localerequired | string | — | The BCP 47 locale of the month and day names ("en-US", "fr-CA"): always explicit. |
className | string | — | Classes merged on the root. |
clearable | boolean | — | Adds a button that empties the value. |
defaultOpen | boolean | false | Opens the calendar at first (a story, a test). |
defaultValue | string | null | null | The chosen date at first, uncontrolled. |
disabled | boolean | — | Not available. |
error | string | — | An error under the field: marks it invalid and is read with it. |
format | "short" | "medium" | "long" | — | short · medium (default) · long: how the button writes the date. |
hint | string | — | A help text under the field. |
isDateDisabled | ((date: string) => boolean) | — | Refuses some dates ((d) => isWeekend(d)). |
labels | Partial<DatePickerLabels> | — | The words, passed translated; English by default. |
max | string | — | The latest date that can be picked. |
min | string | — | The earliest date that can be picked. |
name | string | — | The name of a hidden input holding the ISO value, for a plain <form> post. |
onValueChange | ((value: string | null) => void) | — | Called with the date picked, or null when cleared. |
placeholder | string | — | Shown while nothing is chosen ("Pick a date"), passed translated. |
today | string | — | Today (marked): inject it for a stable server render or a test. Default: the device's date. |
value | string | null | — | The chosen date, ISO (controlled); null for none. |
weekStartsOn | number | — | The first day of the week, 0 = Sunday. Default: the locale's. |
DateRangePicker
A period field: two clicks on one calendar (the days between tinted as you hover), optional presets.
| Prop | Type | Default | Description |
|---|---|---|---|
labelrequired | string | — | The visible label, passed translated (also the button's accessible name, with the value). |
localerequired | string | — | The BCP 47 locale of the month and day names ("en-US", "fr-CA"): always explicit. |
className | string | — | Classes merged on the root. |
clearable | boolean | — | Adds a button that empties the value. |
defaultOpen | boolean | false | Opens the calendar at first (a story, a test). |
defaultValue | { start: string; end: string; } | null | null | The range at first, uncontrolled. |
disabled | boolean | — | Not available. |
error | string | — | An error under the field: marks it invalid and is read with it. |
format | "short" | "medium" | "long" | — | short · medium (default) · long: how the button writes the date. |
hint | string | — | A help text under the field. |
isDateDisabled | ((date: string) => boolean) | — | Refuses some dates ((d) => isWeekend(d)). |
labels | Partial<DatePickerLabels> | — | The words, passed translated; English by default. |
max | string | — | The latest date that can be picked. |
min | string | — | The earliest date that can be picked. |
name | string | — | The name of a hidden input holding the ISO value, for a plain <form> post. |
onValueChange | ((value: { start: string; end: string; } | null) => void) | — | Called once both ends are chosen (or with null when cleared). |
placeholder | string | — | Shown while nothing is chosen ("Pick a date"), passed translated. |
presets | readonly DateRangePreset[] | — | Ranges one click away ("Last 7 days", "This month"), beside the calendar. |
today | string | — | Today (marked): inject it for a stable server render or a test. Default: the device's date. |
value | { start: string; end: string; } | null | — | The chosen range (controlled); null for none. end is never null in a committed value. |
weekStartsOn | number | — | The first day of the week, 0 = Sunday. Default: the locale's. |
Accessibility
- The APG date picker: the month is a
gridlabelled by its title, one day in the tab order, each day named by its full date. - Today carries
aria-current="date"; chosen daysaria-selected; unavailable days are disabled buttons. - The month's title is a polite live region: a change of month is heard.
- The field is a button named by its
<label>, witharia-haspopup="dialog"; Radix returns the focus to it on close.
Keyboard
| Keys | Action |
|---|---|
| Arrow keys | Move by a day or a week. |
| Home / End | First or last day of the week. |
| Page Up / Page Down | Previous or next month (with Shift: year). |
| Enter / Space | Pick the focused day. |
| Esc | Close the calendar and return to the field. |
Best practices
- Always pass the person's
locale: month and day names, the first day of the week and the date's format follow it. - Keep the value as an ISO date in state and in the address; format it only for display.
- Bound the choice with
min/maxandisDateDisabledrather than refusing after the fact. - Offer presets on a period picker: most people want “Last 30 days”, not two clicks.
Related components
Generated from the code of @krizaka/ui 2.4.0: its meta.ts, its examples and its types.Edit this documentation on GitHub