Skip to content

Date Time Picker

A calendar and time popover that picks an instant in a time zone.

Publish app at (UTC)
hero.tsx

Usage guidelines

  • Use DateTimePicker for an instant (Date) shown in an IANA time zone, such as a scheduled publish time. Use DatePicker for a civil date YYYY-MM-DD and TimePicker for a wall time HH:mm. The pickers do not accept typed text.
  • timeZone is 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 with className="sr-only" names a compact field without visible text. FieldLabel nativeLabel={false} render={<div />} also works. Do not point a native label[for] at the trigger: activating it clicks the button.
  • Without a Label, name the trigger and the content with aria-label or aria-labelledby. The trigger's name appends its visible value (or placeholder) to label text; an explicit aria-label replaces 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 IconButton naming contract, so give it an aria-label such as "Clear start date". Place it next to the trigger, never inside the trigger button.
  • Use defaultValue, or value with onValueChange, and keep that choice for the field's lifetime. null means empty, and Clear emits null. details.reason is item-press, clear-press or reset; 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, Escape and an outside press discard it, and reopening starts from the committed value. Changing the controlled value or timeZone starts a fresh draft.
  • Restrict the date with minDate, maxDate (both YYYY-MM-DD in timeZone) and isDateUnavailable, and the time with isTimeUnavailable, 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.
  • hourCycle switches 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 maxHeight only to opt into scrolling the body while the actions stay visible.
  • locale takes a DayPicker locale object and changes formatting and digits, not the calendar system or the stored value. Translate action labels through labels, plus placeholders, requiredLabel and validationMessage. Direction comes from the nearest DirectionProvider; for a local RTL region, also set dir on the wrapper and on the content.
  • With name, the committed value joins native FormData, and an empty field submits ''. Inside a Field, Field.name takes precedence, validate receives the domain value, and Form.onFormSubmit receives the same strings as FormData. Required and invalid fields block submission and focus the first invalid trigger. Reset restores defaultValue. Disabled fields are left out; read-only fields open for browsing and still submit.

Anatomy

tsx
tsx

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.

Workspace time zone
Share link expires at

Stored instant: 2026-12-20T23:00:00.000Z

time-zone.tsx

Available dates and times

minDate and maxDate bound the calendar in the picker's zone, and isTimeUnavailable rules out late-night sends.

Send campaign at (Shanghai)

December 2026 only, 08:00–22:59 Shanghai time.

constraints.tsx

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.

Required
Batch run starts at (UTC)
form.tsx

Keyboard

KeyAction
EnterorSpaceOpens the popup from the trigger and focuses the selected day.
Left arroworRight arrowIn the calendar, moves focus one day, skipping unavailable days and crossing into adjacent months. Reversed in right-to-left.
Up arroworDown arrowIn the calendar, moves focus one week. In a time column, selects the previous or next option, stopping at the ends.
PageUporPageDownIn the calendar, moves focus one month. In a time column, moves the selection five options.
Shift+PageUporShift+PageDownIn the calendar, moves focus one year.
HomeorEndIn the calendar, moves focus to the start or end of the week. In a time column, selects the first or last option.
DigitsIn a time column, selects the option that starts with the typed number.
EnterorSpaceOn 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.
TabMoves between the view's controls and the actions, wrapping inside the popup.
EscapeDiscards 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.

Base UI Popover.Root docs

Props
PropTypeDefaultDetails
placeholderstringNo default
disabledbooleanfalse
readOnlybooleanfalse
requiredbooleanfalse
requiredLabelstring'Required'
invalidbooleanfalse
namestringNo default
formstringNo default
validationMessagestringNo default
onOpenChange((open: boolean, details: PickerOpenChangeDetails) => void)No default
children requiredReact.ReactNodeNo default
localePartial<DayPickerLocale>No default
minDatestringNo default
maxDatestringNo default
isDateUnavailable((date: string) => boolean)No default
hourCycle12 | 2412
valueDate | nullNo default
defaultValueDate | nullnull
onValueChange((value: Date | null, details: DateTimePickerChangeEventDetails) => void)No default
timeZone requiredstringNo default
isTimeUnavailable((wall: Readonly<ZonedWallTime>) => boolean)No default
labelsPartial<DateTimePickerLabels>No default
Base UI Popover.Root docs

DateTimePickerClear

A button component that can be used to trigger actions. Renders a <button> element.

Base UI Button docs

Props
PropTypeDefaultDetails
aria-labelstringNo default
aria-labelledbystringNo default
variant'default' | 'ghost' | 'ghost-accent' | 'primary' | 'secondary' | 'secondary-accent' | 'tertiary''default'
tone'default' | 'destructive''default'
refReact.Ref<HTMLButtonElement>No default
Base UI Button docs

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'
Data attributes
AttributeDescription
data-disabled

Present when the button is disabled.

DateTimePickerContent

A container for the popover contents. Renders a <div> element.

Base UI Popover.Popup docs

Props
PropTypeDefaultDetails
sideOffsetnumber | OffsetFunction8
align'center' | 'end' | 'start''start'
Base UI Popover.Popup docs
Data attributes
AttributeDescription
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: 'top' | 'bottom' | 'left' | 'right' | 'inline-end' | 'inline-start'

Indicates which side the popup is positioned relative to the trigger.

data-align

Values: 'start' | 'center' | 'end'

Indicates how the popup is aligned relative to specified side.

data-instant

Values: 'click' | 'dismiss' | 'focus' | 'trigger-change'

Present if animations should be instant.

CSS variables
VariableDescription
--popup-width

The width of the popup.

--popup-height

The height of the popup.

DateTimePickerLabel

Data attributes
AttributeDescription
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.

Base UI Popover.Trigger docs

Props
PropTypeDefaultDetails
refReact.Ref<HTMLButtonElement>No default
Base UI Popover.Trigger docs
Data attributes
AttributeDescription
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

Props
PropTypeDefaultDetails
children((displayValue: string) => React.ReactNode) | React.ReactNodeNo default