Web · Components
DatePicker
Date picker.
Live example
Preview
Code
Events
- Events appear here when you interact with the preview.
Birth date: future disabled, long display
Appointment: with time, 15-minute steps, Sundays disabled
We're closed on Sundays.
Preview
Code
Events
- Events appear here when you interact with the preview.
Hotel: booked days disabled, 2 to 14 nights
Preview
Code
Events
- Events appear here when you interact with the preview.
Preview
Code
Events
- Events appear here when you interact with the preview.
Card expiry date, a month grid embedded in the page and a form
Preview
Code
Events
- Events appear here when you interact with the preview.
Import
Date picker. The day is typed (28102026 → 28.10.2026) or picked from the dropdown calendar; with time a time is picked too.
- Typing: Separators are added automatically per the locale format (
tr-TR:DD.MM.YYYY); short forms like5.3.26are understood too. When the date is complete, the calendar moves to that day. Invalid or out-of-range text reverts to the old value on blur. - Calendar: Opens on click or with ↓; month and year views, keyboard navigation,
min/max/isDateDisabled, week numbers and marked days work as inCalendar. Closes when a day is picked. - Presets: "Today", "Tomorrow" or your own options with
presets. - Mobile: The keyboard does not open; a tap opens a bottom calendar sheet with large cells, and swiping left/right changes the month. Closes by pulling down and with the back button.
- Form: With
name,"YYYY-MM-DD"(with time"YYYY-MM-DDTHH:mm") is submitted;required,minandmaxwork with browser validation. On the server, convert it to aDatewithparseISODate.
For use with a label, description and error message, see DateField.
Examples
Date range picker. Start and end are typed into two side-by-side fields or picked with two clicks in the dropdown two-month calendar (the range is previewed in between).
- Preset ranges:
presets={["last7Days", "thisMonth", "lastMonth"]}or your own ranges with{ label, value }. - Bounds:
min,max,isDateDisabled; range length withminDays/maxDays. The selected day count is shown at the bottom of the panel. - Typing: Each field is formatted like
DatePicker; if the end is before the start, the ends are swapped. - Mobile: The keyboard does not open; a one-month calendar sheet opens from the bottom, and preset ranges are scrollable buttons on top.
- Form: With
name, an ISO 8601 range"2026-10-01/2026-10-07"is submitted (once both ends are picked);requiredneeds both ends. On the server, split it withparseDateRange.
For use with a label, description and error message, see DateRangeField.
Examples
Month picker: the month is typed (102026 → 10.2026) or picked from the dropdown month grid. For fields that need no day, such as a billing period, card expiry date or monthly report.
- Typing:
10.2026,10/26,1026,2026-10are understood; invalid or out-of-range text reverts to the old value on blur. - Panel: the months of the year in a 3×4 grid; clicking the year shows the year grid. Months are disabled with
min,max,isMonthDisabled. - Display: "October 2026" while not focused (changed with
format). - Mobile: the keyboard does not open; a bottom panel with large cells opens, closed by pulling down and with the back button.
- Form: With
name,"YYYY-MM"is submitted (the native<input type="month">format);required,min,maxwork with browser validation. On the server, convert it to aDatewithparseISOMonth.
For labeled use, see MonthField.
Examples
Year picker: the year is typed or picked from the dropdown 12-year grid (model year, graduation year, annual report).
- Years are disabled with
min,max,isYearDisabled. - Form: With
name,"YYYY"is submitted;required,min,maxwork with browser validation.
For labeled use, see YearField.
Examples
Time picker. Typed ("1430" → 14:30) or picked from the hour and minute columns of the dropdown panel.
:is added automatically while typing; loose forms like9,930,9.30are understood too. Unparsable text reverts to the old value on blur.- Columns change with ↑/↓; the panel closes when a minute is picked.
- Times outside
min/maxare disabled in the columns and checked by browser validation (rangeUnderflow/rangeOverflow). - Mobile: The keyboard does not open; a tap opens a bottom sheet with columns. Closes by pulling down and with the back button.
- Form: With
name,"HH:mm"is submitted;requiredworks, and it returns to the initial value when the form is reset.
For use with a label, description and error message, see TimeField.
Examples
DatePreset
typePresets of the single date picker.
DateRangePreset
typePresets of the date range picker.
DatePickerProps
interfaceProps of the DatePicker component.
Extends: Pick<CalendarBaseProps, "min" | "max" | "isDateDisabled" | "weekStartsOn" | "showWeekNumbers" | "marks">
| Name | Type | Default | Description |
|---|---|---|---|
value? | DateInput | Selected day when controlled: "2026-10-28" (with time "2026-10-28T14:30") or a Date; "" for none. | |
defaultValue? | DateInput | Initial day when uncontrolled. | |
onValueChange? | (value: string, date: Date | undefined) => void | Called with the ISO text and a Date when the selection changes ("" and undefined when cleared). With time, the text is in "YYYY-MM-DDTHH:mm" format. | |
time? | boolean | false | Should a time be selected along with the date? Hour and minute columns appear next to the calendar in the panel; the value switches to the "2026-10-28T14:30" format. |
minuteStep? | number | 5 | Step of the minute list when using time. |
presets? | readonly DatePreset[] | Presets in the panel: "today", "yesterday", "tomorrow" or { label, value }. Shown to the left of the calendar on desktop and as scrollable buttons above it on mobile. | |
todayButton? | boolean | true` when there are no `presets | "Today" button at the bottom of the panel. |
format? | Intl.DateTimeFormatOptions | Display format of the value while the field is not focused (e.g. { dateStyle: "long" } → "October 28, 2026"). If omitted, the numeric format used while typing (28.10.2026) is used. | |
variant? | FieldVariant | CustomVariant<"field"> | Appearance: outline (bordered), filled, underline or ghost (plain). If omitted, the setting of the nearest data-field-variant container is used, or outline if there is none. See FieldVariant. | |
effect? | EffectProp | Effect or effects of the field box (e.g. "glow", ["lift", "beam"]). The accent color is the focus color (--ui-field-focus). If omitted, UIProvider appearance.defaults.field.effect. See BuiltinEffect. | |
name? | string | Form field name; the value is submitted under this name in ISO format. | |
form? | string | Id of the form the field belongs to (if outside the form). | |
required? | boolean | The form cannot be submitted without a value. | |
disabled? | boolean | Disabled. | |
readOnly? | boolean | The value is visible but cannot be changed; the panel does not open. | |
id? | string | Id of the text field; <Label htmlFor> binds to it. | |
autoFocus? | boolean | Focused when the page opens. | |
placeholder? | string | Text shown when empty. If omitted, the locale format (DD.MM.YYYY). | |
clearable? | boolean | false | Show the × button that clears the value? |
icon? | IconProp | Icon at the start of the box. | |
side? | Placement | "auto" | Position of the panel relative to the field. See Placement. On mobile the panel is a bottom sheet. |
open? | boolean | Whether the panel is open when controlled. | |
defaultOpen? | boolean | false | Is it initially open when uncontrolled? |
onOpenChange? | (open: boolean) => void | Called when the panel opens or closes. | |
tooltip? | TooltipProp | Hint shown when hovering the box. In labeled fields the hint is shown on the ⓘ icon next to the label. See TooltipProp. | |
className? | string | Classes added to the container (e.g. w-56 for width). | |
classNames? | PickerClassNames | Classes added to the inner parts. | |
aria-label? | string | Screen reader name when there is no visible label. | |
aria-labelledby? | string | Id of the element naming the field. | |
aria-describedby? | string | Id of the element describing the field. Ready-made fields set it themselves. | |
aria-invalid? | boolean | "true" | "false" | Show the field as invalid (red border). Ready-made fields set it themselves. |
DateRangePickerProps
interfaceProps of the DateRangePicker component.
Extends: Pick<CalendarBaseProps, "min" | "max" | "isDateDisabled" | "weekStartsOn" | "showWeekNumbers" | "marks">
| Name | Type | Default | Description |
|---|---|---|---|
value? | DateRangeInput | Selected range when controlled. | |
defaultValue? | DateRangeInput | Initial range when uncontrolled. | |
onValueChange? | (range: DateRange) => void | Called when the range changes; end is empty until the end is selected. | |
minDays? | number | Minimum number of days in the range (both ends included). | |
maxDays? | number | Maximum number of days in the range (both ends included). | |
months? | number | 2 | Number of months shown side by side on desktop; always 1 on mobile. |
presets? | readonly DateRangePreset[] | Preset ranges: "today", "yesterday", "last7Days", "last30Days", "thisWeek", "thisMonth", "lastMonth", "thisYear" or { label, value }. A column on the left on desktop, a button row on top on mobile. | |
variant? | FieldVariant | CustomVariant<"field"> | Appearance: outline (bordered), filled, underline or ghost (plain). If omitted, the setting of the nearest data-field-variant container is used, or outline if there is none. See FieldVariant. | |
effect? | EffectProp | Effect or effects of the field box (e.g. "glow", ["lift", "beam"]). The accent color is the focus color (--ui-field-focus). If omitted, UIProvider appearance.defaults.field.effect. See BuiltinEffect. | |
name? | string | Form field name; the value is submitted under this name in ISO format. | |
form? | string | Id of the form the field belongs to (if outside the form). | |
required? | boolean | The form cannot be submitted without a value. | |
disabled? | boolean | Disabled. | |
readOnly? | boolean | The value is visible but cannot be changed; the panel does not open. | |
id? | string | Id of the text field; <Label htmlFor> binds to it. | |
autoFocus? | boolean | Focused when the page opens. | |
placeholder? | string | Text shown when empty. If omitted, the locale format (DD.MM.YYYY). | |
clearable? | boolean | false | Show the × button that clears the value? |
icon? | IconProp | Icon at the start of the box. | |
side? | Placement | "auto" | Position of the panel relative to the field. See Placement. On mobile the panel is a bottom sheet. |
open? | boolean | Whether the panel is open when controlled. | |
defaultOpen? | boolean | false | Is it initially open when uncontrolled? |
onOpenChange? | (open: boolean) => void | Called when the panel opens or closes. | |
tooltip? | TooltipProp | Hint shown when hovering the box. In labeled fields the hint is shown on the ⓘ icon next to the label. See TooltipProp. | |
className? | string | Classes added to the container (e.g. w-56 for width). | |
classNames? | PickerClassNames | Classes added to the inner parts. | |
aria-label? | string | Screen reader name when there is no visible label. | |
aria-labelledby? | string | Id of the element naming the field. | |
aria-describedby? | string | Id of the element describing the field. Ready-made fields set it themselves. | |
aria-invalid? | boolean | "true" | "false" | Show the field as invalid (red border). Ready-made fields set it themselves. |
MonthPreset
typePresets in the MonthPicker panel.
MonthPickerProps
interfaceProps of the MonthPicker component.
Extends: Pick<MonthCalendarProps, "min" | "max" | "isMonthDisabled" | "monthFormat">
| Name | Type | Default | Description |
|---|---|---|---|
value? | DateInput | Selected month when controlled: "2026-10", a date string or a Date; "" for none. | |
defaultValue? | DateInput | Initial month when uncontrolled. | |
onValueChange? | (value: string, date: Date | undefined) => void | Called with "YYYY-MM" and the first day of the month when the selection changes ("", undefined when cleared). | |
format? | Intl.DateTimeFormatOptions | false | { month: "long", year: "numeric" } | Display format of the value while the field is not focused. If omitted, with the month name ("October 2026"); if false, in the typed format (10.2026). |
presets? | readonly MonthPreset[] | Presets: "thisMonth", "lastMonth" or { label, value }. | |
currentButton? | boolean | true` when there are no `presets | "This month" button at the bottom of the panel. |
variant? | FieldVariant | CustomVariant<"field"> | Appearance: outline (bordered), filled, underline or ghost (plain). If omitted, the setting of the nearest data-field-variant container is used, or outline if there is none. See FieldVariant. | |
effect? | EffectProp | Effect or effects of the field box (e.g. "glow", ["lift", "beam"]). The accent color is the focus color (--ui-field-focus). If omitted, UIProvider appearance.defaults.field.effect. See BuiltinEffect. | |
name? | string | Form field name; the value is submitted under this name in ISO format. | |
form? | string | Id of the form the field belongs to (if outside the form). | |
required? | boolean | The form cannot be submitted without a value. | |
disabled? | boolean | Disabled. | |
readOnly? | boolean | The value is visible but cannot be changed; the panel does not open. | |
id? | string | Id of the text field; <Label htmlFor> binds to it. | |
autoFocus? | boolean | Focused when the page opens. | |
placeholder? | string | Text shown when empty. If omitted, the locale format (DD.MM.YYYY). | |
clearable? | boolean | false | Show the × button that clears the value? |
icon? | IconProp | Icon at the start of the box. | |
side? | Placement | "auto" | Position of the panel relative to the field. See Placement. On mobile the panel is a bottom sheet. |
open? | boolean | Whether the panel is open when controlled. | |
defaultOpen? | boolean | false | Is it initially open when uncontrolled? |
onOpenChange? | (open: boolean) => void | Called when the panel opens or closes. | |
tooltip? | TooltipProp | Hint shown when hovering the box. In labeled fields the hint is shown on the ⓘ icon next to the label. See TooltipProp. | |
className? | string | Classes added to the container (e.g. w-56 for width). | |
classNames? | PickerClassNames | Classes added to the inner parts. | |
aria-label? | string | Screen reader name when there is no visible label. | |
aria-labelledby? | string | Id of the element naming the field. | |
aria-describedby? | string | Id of the element describing the field. Ready-made fields set it themselves. | |
aria-invalid? | boolean | "true" | "false" | Show the field as invalid (red border). Ready-made fields set it themselves. |
YearPickerProps
interfaceProps of the YearPicker component.
| Name | Type | Default | Description |
|---|---|---|---|
value? | YearInput | Selected year when controlled: 2026, "2026" or a Date; "" for none. | |
defaultValue? | YearInput | Initial year when uncontrolled. | |
onValueChange? | (value: string, year: number | undefined) => void | Called with the "YYYY" text and the year number when the selection changes ("", undefined when cleared). | |
min? | YearInput | Earliest selectable year. | |
max? | YearInput | Latest selectable year. | |
isYearDisabled? | (year: number) => boolean | Function for years that cannot be selected. | |
currentButton? | boolean | true | "This year" button at the bottom of the panel. |
variant? | FieldVariant | CustomVariant<"field"> | Appearance: outline (bordered), filled, underline or ghost (plain). If omitted, the setting of the nearest data-field-variant container is used, or outline if there is none. See FieldVariant. | |
effect? | EffectProp | Effect or effects of the field box (e.g. "glow", ["lift", "beam"]). The accent color is the focus color (--ui-field-focus). If omitted, UIProvider appearance.defaults.field.effect. See BuiltinEffect. | |
name? | string | Form field name; the value is submitted under this name in ISO format. | |
form? | string | Id of the form the field belongs to (if outside the form). | |
required? | boolean | The form cannot be submitted without a value. | |
disabled? | boolean | Disabled. | |
readOnly? | boolean | The value is visible but cannot be changed; the panel does not open. | |
id? | string | Id of the text field; <Label htmlFor> binds to it. | |
autoFocus? | boolean | Focused when the page opens. | |
placeholder? | string | Text shown when empty. If omitted, the locale format (DD.MM.YYYY). | |
clearable? | boolean | false | Show the × button that clears the value? |
icon? | IconProp | Icon at the start of the box. | |
side? | Placement | "auto" | Position of the panel relative to the field. See Placement. On mobile the panel is a bottom sheet. |
open? | boolean | Whether the panel is open when controlled. | |
defaultOpen? | boolean | false | Is it initially open when uncontrolled? |
onOpenChange? | (open: boolean) => void | Called when the panel opens or closes. | |
tooltip? | TooltipProp | Hint shown when hovering the box. In labeled fields the hint is shown on the ⓘ icon next to the label. See TooltipProp. | |
className? | string | Classes added to the container (e.g. w-56 for width). | |
classNames? | PickerClassNames | Classes added to the inner parts. | |
aria-label? | string | Screen reader name when there is no visible label. | |
aria-labelledby? | string | Id of the element naming the field. | |
aria-describedby? | string | Id of the element describing the field. Ready-made fields set it themselves. | |
aria-invalid? | boolean | "true" | "false" | Show the field as invalid (red border). Ready-made fields set it themselves. |
PickerClassNames
interfaceClasses that can be passed to the inner parts of the date and time pickers.
| Name | Type | Description |
|---|---|---|
box? | string | The visible box of the field (text field and buttons). |
input? | string | Text field (both fields in a range). |
content? | string | Dropdown panel. |
PickerBaseProps
interfaceProps shared by all date/time pickers.
| Name | Type | Default | Description |
|---|---|---|---|
variant? | FieldVariant | CustomVariant<"field"> | Appearance: outline (bordered), filled, underline or ghost (plain). If omitted, the setting of the nearest data-field-variant container is used, or outline if there is none. See FieldVariant. | |
effect? | EffectProp | Effect or effects of the field box (e.g. "glow", ["lift", "beam"]). The accent color is the focus color (--ui-field-focus). If omitted, UIProvider appearance.defaults.field.effect. See BuiltinEffect. | |
name? | string | Form field name; the value is submitted under this name in ISO format. | |
form? | string | Id of the form the field belongs to (if outside the form). | |
required? | boolean | The form cannot be submitted without a value. | |
disabled? | boolean | Disabled. | |
readOnly? | boolean | The value is visible but cannot be changed; the panel does not open. | |
id? | string | Id of the text field; <Label htmlFor> binds to it. | |
autoFocus? | boolean | Focused when the page opens. | |
placeholder? | string | Text shown when empty. If omitted, the locale format (DD.MM.YYYY). | |
clearable? | boolean | false | Show the × button that clears the value? |
icon? | IconProp | Icon at the start of the box. | |
side? | Placement | "auto" | Position of the panel relative to the field. See Placement. On mobile the panel is a bottom sheet. |
open? | boolean | Whether the panel is open when controlled. | |
defaultOpen? | boolean | false | Is it initially open when uncontrolled? |
onOpenChange? | (open: boolean) => void | Called when the panel opens or closes. | |
tooltip? | TooltipProp | Hint shown when hovering the box. In labeled fields the hint is shown on the ⓘ icon next to the label. See TooltipProp. | |
className? | string | Classes added to the container (e.g. w-56 for width). | |
classNames? | PickerClassNames | Classes added to the inner parts. | |
aria-label? | string | Screen reader name when there is no visible label. | |
aria-labelledby? | string | Id of the element naming the field. | |
aria-describedby? | string | Id of the element describing the field. Ready-made fields set it themselves. | |
aria-invalid? | boolean | "true" | "false" | Show the field as invalid (red border). Ready-made fields set it themselves. |
TimePickerProps
interfaceProps of the TimePicker component.
| Name | Type | Default | Description |
|---|---|---|---|
value? | string | Selected time when controlled ("14:30"); "" for none. | |
defaultValue? | string | Initial time when uncontrolled. | |
onValueChange? | (value: string) => void | Called with "HH:mm" ("" when cleared) when the time changes. | |
min? | string | Earliest selectable time ("09:00"). | |
max? | string | Latest selectable time ("18:00"). | |
minuteStep? | number | 5 | Step of the minute list (e.g. 15 → 00, 15, 30, 45). Any minute can be typed manually. |
nowButton? | boolean | true | Show the "Now" button in the panel? |
variant? | FieldVariant | CustomVariant<"field"> | Appearance: outline (bordered), filled, underline or ghost (plain). If omitted, the setting of the nearest data-field-variant container is used, or outline if there is none. See FieldVariant. | |
effect? | EffectProp | Effect or effects of the field box (e.g. "glow", ["lift", "beam"]). The accent color is the focus color (--ui-field-focus). If omitted, UIProvider appearance.defaults.field.effect. See BuiltinEffect. | |
name? | string | Form field name; the value is submitted under this name in ISO format. | |
form? | string | Id of the form the field belongs to (if outside the form). | |
required? | boolean | The form cannot be submitted without a value. | |
disabled? | boolean | Disabled. | |
readOnly? | boolean | The value is visible but cannot be changed; the panel does not open. | |
id? | string | Id of the text field; <Label htmlFor> binds to it. | |
autoFocus? | boolean | Focused when the page opens. | |
placeholder? | string | Text shown when empty. If omitted, the locale format (DD.MM.YYYY). | |
clearable? | boolean | false | Show the × button that clears the value? |
icon? | IconProp | Icon at the start of the box. | |
side? | Placement | "auto" | Position of the panel relative to the field. See Placement. On mobile the panel is a bottom sheet. |
open? | boolean | Whether the panel is open when controlled. | |
defaultOpen? | boolean | false | Is it initially open when uncontrolled? |
onOpenChange? | (open: boolean) => void | Called when the panel opens or closes. | |
tooltip? | TooltipProp | Hint shown when hovering the box. In labeled fields the hint is shown on the ⓘ icon next to the label. See TooltipProp. | |
className? | string | Classes added to the container (e.g. w-56 for width). | |
classNames? | PickerClassNames | Classes added to the inner parts. | |
aria-label? | string | Screen reader name when there is no visible label. | |
aria-labelledby? | string | Id of the element naming the field. | |
aria-describedby? | string | Id of the element describing the field. Ready-made fields set it themselves. | |
aria-invalid? | boolean | "true" | "false" | Show the field as invalid (red border). Ready-made fields set it themselves. |