Date Time Picker
A calendar and time popover that picks an instant in a time zone.
Usage guidelines
- Use
DateTimePickerfor an instant (Date) shown in an IANA time zone, such as a scheduled publish time. UseDatePickerfor a civil dateYYYY-MM-DDandTimePickerfor a wall timeHH:mm. The pickers do not accept typed text. timeZoneis required and controls display, editing and Now. The value stays an instant and submits as an ISO 8601 UTC string. Parse API payloads and convert business values outside the picker.- Name the field at the call site: prefer one visible picker Label. It names both the trigger and the popup through
aria-labelledby, and clicking its text focuses the trigger without opening it. A Label withclassName="sr-only"names a compact field without visible text.FieldLabel nativeLabel={false} render={<div />}also works. Do not point a nativelabel[for]at the trigger: activating it clicks the button. - Without a Label, name the trigger and the content with
aria-labeloraria-labelledby. The trigger's name appends its visible value (or placeholder) to label text; an explicitaria-labelreplaces the whole name, so include the visible value in it. Put meaningful annotations inside the Value part so they join the name. - Name Clear explicitly: Clear follows the
IconButtonnaming contract, so give it anaria-labelsuch as "Clear start date". Place it next to the trigger, never inside the trigger button. - Use
defaultValue, orvaluewithonValueChange, and keep that choice for the field's lifetime.nullmeans empty, and Clear emitsnull.details.reasonisitem-press,clear-pressorreset;details.cancel()rejects that change and its follow-up close. Unchanged values do not emit again. - Edits in the popup, including Now, stay in a draft until OK. Switching between the date and time views keeps the draft. Close,
Escapeand an outside press discard it, and reopening starts from the committed value. Changing the controlled value ortimeZonestarts a fresh draft. - Restrict the date with
minDate,maxDate(bothYYYY-MM-DDintimeZone) andisDateUnavailable, and the time withisTimeUnavailable, which receives the wall date and time. Unavailable drafts stay reachable, but OK is disabled and the reason is announced. - The picker edits whole minutes. It rejects a wall time skipped by daylight saving, keeps an unchanged instant during a repeated hour, and resolves an edited repeated time to the earlier instant.
hourCycleswitches between 12-hour (default) and 24-hour display.- Content keeps its natural height and flips above or below the trigger; it does not shrink on small screens. Pass
maxHeightonly to opt into scrolling the body while the actions stay visible. localetakes a DayPicker locale object and changes formatting and digits, not the calendar system or the stored value. Translate action labels throughlabels, plus placeholders,requiredLabelandvalidationMessage. Direction comes from the nearestDirectionProvider; for a local RTL region, also setdiron the wrapper and on the content.- With
name, the committed value joins nativeFormData, and an empty field submits''. Inside aField,Field.nametakes precedence,validatereceives the domain value, andForm.onFormSubmitreceives the same strings asFormData. Required and invalid fields block submission and focus the first invalid trigger. Reset restoresdefaultValue. Disabled fields are left out; read-only fields open for browsing and still submit.
Anatomy
DateTimePickerTrigger is a native button whose default children are the Value and a decorative calendar icon. When you replace them, include exactly one DateTimePickerValue and keep the trailing calendar icon; its render callback receives the formatted text, not the raw value. DateTimePickerContent owns the portal, initial focus, calendar, columns and actions.
Examples
Time zone
The same instant reads differently in each zone. Changing timeZone changes what the trigger shows, not the stored Date. The zone suffix lives inside DateTimePickerValue, so it is part of the trigger's name.
Stored instant: 2026-12-20T23:00:00.000Z
Available dates and times
minDate and maxDate bound the calendar in the picker's zone, and isTimeUnavailable rules out late-night sends.
December 2026 only, 08:00–22:59 Shanghai time.
Native form
With name, the picker submits the instant as an ISO 8601 UTC string. A required empty field blocks submission and focuses its trigger.
Keyboard
| Key | Action |
|---|---|
| EnterorSpace | Opens the popup from the trigger and focuses the selected day. |
| Left arroworRight arrow | In the calendar, moves focus one day, skipping unavailable days and crossing into adjacent months. Reversed in right-to-left. |
| Up arroworDown arrow | In the calendar, moves focus one week. In a time column, selects the previous or next option, stopping at the ends. |
| PageUporPageDown | In the calendar, moves focus one month. In a time column, moves the selection five options. |
| Shift+PageUporShift+PageDown | In the calendar, moves focus one year. |
| HomeorEnd | In the calendar, moves focus to the start or end of the week. In a time column, selects the first or last option. |
| Digits | In a time column, selects the option that starts with the typed number. |
| EnterorSpace | On a day, selects it in the draft. On Pick Time or Pick Date, switches the view and keeps the draft. On OK, commits the draft, closes the popup and returns focus to the trigger. |
| Tab | Moves between the view's controls and the actions, wrapping inside the popup. |
| Escape | Discards the draft, closes the popup and returns focus to the trigger. |
The month and year selector in the date view works as in DatePicker: ArrowUp and ArrowDown move one option, PageUp and PageDown move five, Home and End reach the ends, digits locate a year and letters locate a month. Escape discards the selection and returns focus to the month title.
API reference
DateTimePicker
Groups all parts of a date-and-time picker storing a Date instant formatted in timeZone. Doesn't render its own HTML element.
Popup edits stay in a draft until confirmed with the apply button; also commits on clearing or form reset.
| Prop | Type | Default | Details |
|---|---|---|---|
placeholder | string | No default | |
disabled | boolean | false | |
readOnly | boolean | false | |
required | boolean | false | |
requiredLabel | string | 'Required' | |
invalid | boolean | false | |
name | string | No default | |
form | string | No default | |
validationMessage | string | No default | |
onOpenChange | ((open: boolean, details: PickerOpenChangeDetails) => void) | No default | |
children required | React.ReactNode | No default | |
locale | Partial<DayPickerLocale> | No default | |
minDate | string | No default | |
maxDate | string | No default | |
isDateUnavailable | ((date: string) => boolean) | No default | |
hourCycle | 12 | 24 | 12 | |
value | Date | null | No default | |
defaultValue | Date | null | null | |
onValueChange | ((value: Date | null, details: DateTimePickerChangeEventDetails) => void) | No default | |
timeZone required | string | No default | |
isTimeUnavailable | ((wall: Readonly<ZonedWallTime>) => boolean) | No default | |
labels | Partial<DateTimePickerLabels> | No default | |
defaultOpen | boolean | false | |
open | boolean | No default | |
DateTimePickerClear
A button component that can be used to trigger actions. Renders a <button> element.
| Prop | Type | Default | Details |
|---|---|---|---|
aria-label | string | No default | |
aria-labelledby | string | No default | |
variant | 'default' | 'ghost' | 'ghost-accent' | 'primary' | 'secondary' | 'secondary-accent' | 'tertiary' | 'default' | |
tone | 'default' | 'destructive' | 'default' | |
ref | React.Ref<HTMLButtonElement> | No default | |
className | string | ((state: ButtonState) => string | undefined) | No default | |
style | React.CSSProperties | ((state: ButtonState) => React.CSSProperties | undefined) | No default | |
focusableWhenDisabled | boolean | false | |
Valid prop combinations:
aria-label: string,aria-labelledby?: undefined,variant?: 'default' | 'ghost' | 'primary' | 'secondary' | 'tertiary',tone?: 'default' | 'destructive'aria-label: string,aria-labelledby?: undefined,variant: 'ghost-accent' | 'secondary-accent',tone?: 'default'aria-label?: undefined,aria-labelledby: string,variant?: 'default' | 'ghost' | 'primary' | 'secondary' | 'tertiary',tone?: 'default' | 'destructive'aria-label?: undefined,aria-labelledby: string,variant: 'ghost-accent' | 'secondary-accent',tone?: 'default'
| Attribute | Description |
|---|---|
data-disabled | Present when the button is disabled. |
DateTimePickerContent
A container for the popover contents. Renders a <div> element.
| Prop | Type | Default | Details |
|---|---|---|---|
sideOffset | number | OffsetFunction | 8 | |
align | 'center' | 'end' | 'start' | 'start' | |
className | string | ((state: PopoverPopupState) => string | undefined) | No default | |
style | React.CSSProperties | ((state: PopoverPopupState) => React.CSSProperties | undefined) | No default | |
side | 'bottom' | 'inline-end' | 'inline-start' | 'left' | 'right' | 'top' | 'bottom' | |
alignOffset | number | OffsetFunction | 0 | |
finalFocus | boolean | React.RefObject<HTMLElement | null> | ((closeType: InteractionType) => void | boolean | HTMLElement | null) | No default | |
| Attribute | Description |
|---|---|
data-open | Present when the popup is open. |
data-closed | Present when the popup is closed. |
data-starting-style | Present when the popup begins animating in. |
data-ending-style | Present when the popup is animating out. |
data-side | Values: Indicates which side the popup is positioned relative to the trigger. |
data-align | Values: Indicates how the popup is aligned relative to specified side. |
data-instant | Values: Present if animations should be instant. |
| Variable | Description |
|---|---|
--popup-width | The width of the popup. |
--popup-height | The height of the popup. |
DateTimePickerLabel
| Prop | Type | Default | Details |
|---|---|---|---|
className | string | ((state: FieldRootState) => string | undefined) | No default | |
style | React.CSSProperties | ((state: FieldRootState) => React.CSSProperties | undefined) | No default | |
| Attribute | Description |
|---|---|
data-disabled | Present when the component should ignore user interaction. |
data-touched | Present when the field has been touched. |
data-dirty | Present when the field value has changed from its initial value. |
data-filled | Present when the field has a value. |
data-focused | Present when the field is focused. |
DateTimePickerTrigger
A button that opens the popover. Renders a <button> element.
| Prop | Type | Default | Details |
|---|---|---|---|
ref | React.Ref<HTMLButtonElement> | No default | |
id | string | No default | |
className | string | ((state: PopoverTriggerState) => string | undefined) | No default | |
style | React.CSSProperties | ((state: PopoverTriggerState) => React.CSSProperties | undefined) | No default | |
| Attribute | Description |
|---|---|
data-readonly | Present when the picker is read-only. |
data-required | Present when the picker requires a value. |
data-popup-open | Present when the corresponding popover is open. |
data-pressed | Present when the trigger is pressed. |
data-disabled | Present when the trigger is disabled. |
DateTimePickerValue
| Prop | Type | Default | Details |
|---|---|---|---|
children | ((displayValue: string) => React.ReactNode) | React.ReactNode | No default | |