Components · Form & Input
Date Time Picker
A DatePicker and a TimePicker that edit one Date, with an optional time-zone label.
import { DateTimePicker } from '@nexub/react';Playground
Props
Pick a date first; the time defaults to 09:00.
<DateTimePicker aria-label="Meeting starts" value={starts} onValueChange={setStarts} timeZone="Asia/Singapore" minuteStep={15} />Examples
Meeting start
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
| Prop | Type | Default | Description |
|---|---|---|---|
| value | Date | — | Date and time in the reader’s local time. |
| onValueChange | ((value: Date) => void) | — | Date and time in the reader’s local time. |
| defaultTime | string | '09:00' | Time used when the date is picked first. |
| minuteStep | number | — | Passed to the TimePicker. |
| minDate | Date | — | Limits the calendar. |
| maxDate | Date | — | Limits the calendar. |
| timeZone | string | — | IANA zone named next to the fields, e.g. "Time zone: GMT+8 (Asia/Singapore)". Label only. |
| aria-label | string | — | Names the group; the parts read "Date" and "Time". |
| clearable | boolean | — | 11.2: a clear button empties the value. |
| className | string | — | |
| disabled | boolean | — | |
| invalid | boolean | — | |
| locale | Locale | — | |
| readOnly | boolean | — | Both fields show the value but can't be changed. |
| sheet | false | 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.
On iOS & Android: DateTimeField
import { DateTimeField } from '@nexub/react-native';
<DateTimeField label="Date" mode="date" value={start} onValueChange={setStart} />
<DateTimeField label="Time" mode="time" value={start} onValueChange={setStart} />Web vs mobile
Same tokens and prop names. Where the platforms differ:
| Web | iOS & Android | |
|---|---|---|
| Fields | One group: date button and time input. | Two DateTimeFields, mode="date" and mode="time", on the same Date. |
Interactive preview of @nexub/react-native rendered for the web. Native chrome (switches, pickers, Liquid Glass) looks like the platform on a device.
On device

iPhone (iOS simulator)

Pixel (Android emulator)
Screenshots from the latest CI run of the showcase app; the live frame renders the same code for the web.
DateTimeField props
| Prop | Type | Default | Description |
|---|---|---|---|
| value | Date | string | null | — | The value; null is empty. A 'YYYY-MM-DD' string is read too. Leave it out for an uncontrolled field. |
| defaultValue | Date | string | null | — | 11.8: the starting value of an uncontrolled field, in the same shape as value. |
| onValueChange | DateTimeFieldChangeHandler | — | Called with the new Date, or null when cleared. |
| granularity | 'day' | 'day' | 11.8: 'month' or 'year' picks a whole month or year instead: see DateTimeFieldPeriodProps. |
| labelrequired | string | — | Visible label above the field; also its accessible name and the picker sheet's title. |
| mode | 'date' | 'time' | 'datetime' | 'date' | What the platform picker edits. 11.8: 'datetime' picks a date and then a time in one field. |
| minDate | Date | — | Earliest date the picker allows. With month or year granularity, earlier months or years are disabled. |
| maxDate | Date | — | Latest date the picker allows. With month or year granularity, later months or years are disabled. |
| placeholder | string | messages.pickDate (pickMonth / pickYear for those granularities) | Text shown while empty. |
| disabled | boolean | false | 11.8: dimmed, can't be opened or cleared, and read as disabled. |
| readOnly | boolean | false | 11.8: shows the value, but the picker can't open and the value can't be cleared. Still focusable. |
| invalid | boolean | false | 11.8: red outline, and the field is marked invalid for screen readers. Give error for a message too. |
| error | string | — | 11.8: error message under the field: red outline, announced, read as the field's hint. |
| size | Extract<ControlSize, 'md' | 'lg' | 'xl'> | 'lg' | 11.8: field height (the TextField sizes). |
| locale | string | the provider's locale | 11.8: BCP 47 locale for the field's text and the iOS picker. |
| disabledDates | DateMatcher | DateMatcher[] | — | 11.8: days that can't be picked: one rule or a list (see DateMatcher), as web. The platform
picker can't grey days out, so picking one keeps the old value and says the day is unavailable.
Presets on such days are disabled. |
| presets | { label: string; date: Date }[] | — | 11.8: quick picks shown as chips under the field (Today, Tomorrow…); a tap sets the value.
In datetime mode the time of the current value (or defaultTime) is kept. Not for time mode
or month and year granularity. |
| minuteStep | number | 1 | 11.8: minutes between choices in time and datetime modes. iOS uses it as the wheel's interval; elsewhere the picked time is rounded to it. |
| clearable | boolean | false | 11.8: a clear button inside the field while it has a value; clearing calls onValueChange(null). |
| loading | boolean | false | 11.8: spinner at the end of the field, and busy for screen readers. |
| defaultTime | string | '09:00' | 11.8: 24-hour "HH:mm" time a date gets when it is picked before any time (date and datetime modes). |
| timeZone | string | — | 11.8: IANA time zone ('Europe/Paris') the value is shown and picked in, with its name under
the field. The value is still an instant (Date). |
| leadingIcon | React.ComponentType<NativeIconProps> | Calendar (Clock in time mode) | 11.8: icon at the start of the field. |
| trailingIcon | React.ComponentType<NativeIconProps> | — | 11.8: icon at the end of the field. |
| leadingAddon | React.ReactNode | — | 11.8: text or a node at the start of the field, e.g. "From". A string is read with the value. |
| trailingAddon | React.ReactNode | — | 11.8: text or a node at the end of the field, e.g. "local time". A string is read with the value. |
| style | StyleProp<ViewStyle> | — | — |