Skip to content
nexubDesign System
v11.9.0

Components · Form & Input

Date Time Picker

BetaAdded v6.2.0

A DatePicker and a TimePicker that edit one Date, with an optional time-zone label.

import { DateTimePicker } from '@nexub/react';
View as Markdown

Playground

Props

size
Time zone: GMT+8 (Asia/Singapore)

Pick a date first; the time defaults to 09:00.

TSX
<DateTimePicker aria-label="Meeting starts" value={starts} onValueChange={setStarts} timeZone="Asia/Singapore" minuteStep={15} />

Examples

Meeting start

Time zone: GMT+8 (Asia/Singapore)

Pick a date first; the time defaults to 09:00.

Clearable reminder

States

  • Time zone: GMT+8 (Asia/Singapore)

    Pick a date first; the time defaults to 09:00.

    default
  • Time zone: GMT+8 (Asia/Singapore)

    Pick a date first; the time defaults to 09:00.

    disabled
  • Time zone: GMT+8 (Asia/Singapore)

    Pick a date first; the time defaults to 09:00.

    invalid
  • Time zone: GMT+8 (Asia/Singapore)

    Pick a date first; the time defaults to 09:00.

    readOnly
  • Time zone: GMT+8 (Asia/Singapore)

    Pick a date first; the time defaults to 09:00.

    size="sm"
  • Time zone: GMT+8 (Asia/Singapore)

    Pick a date first; the time defaults to 09:00.

    size="md"
  • Time zone: GMT+8 (Asia/Singapore)

    Pick a date first; the time defaults to 09:00.

    size="lg"

Props

Props
PropTypeDefaultDescription
valueDate—Date and time in the reader’s local time.
onValueChange((value: Date) => void)—Date and time in the reader’s local time.
defaultTimestring'09:00'Time used when the date is picked first.
minuteStepnumber—Passed to the TimePicker.
minDateDate—Limits the calendar.
maxDateDate—Limits the calendar.
timeZonestring—IANA zone named next to the fields, e.g. "Time zone: GMT+8 (Asia/Singapore)". Label only.
aria-labelstring—Names the group; the parts read "Date" and "Time".
clearableboolean—11.2: a clear button empties the value.
classNamestring—
disabledboolean—
invalidboolean—
localeLocale—
readOnlyboolean—Both fields show the value but can't be changed.
sheetfalse | true | 'auto''auto' (pass `sheet={false}` to keep a popover on small screens)The calendar as a bottom sheet: see DatePicker sheet.
size'sm' | 'md' | 'lg''md'

Accessibility

Notes

  • A labelled group holding the DatePicker button and the native time input.