Date Picker
A date and time picker: iOS 27's compact capsules, inline calendar and wheels; Material 3's date and time dialogs on Android.
import { DatePicker } from "@plexui/react-native"The value is a plain Date in the device's time zone; a day keeps its time when only the day changes, and the other way round.
Examples
Overview
Platforms
| iOS 27 | Android | |
|---|---|---|
| Native component | UIDatePicker (.compact, .inline, .wheels), SwiftUI DatePicker | DatePicker and TimePicker of Material 3 (DatePickerDialog, TimePicker dial); spinner mode |
| Compact | Capsules that open the calendar and the wheels in a popover | A row's value or an outlined field that opens the dialog; OK applies |
| Inline | The month's calendar in place, a Time row under it | Material's calendar in place |
| Wheels | Wheels with a 32 band, turning round; rows out of range in a lighter tone | Spinners between two lines, turning round, stopping at min and max |
API
| Prop | Type | Default | Description |
|---|---|---|---|
value | Date | null | — | The date and time chosen, null for none yet (required) |
onChange | (value: Date) => void | — | Called with the new date (required) |
mode | "date" | "time" | "datetime" | "date" | A day, a time, or both |
display | "compact" | "inline" | "wheels" | "compact" | Capsules or a field that open a popover or a dialog, the calendar in place, or wheels |
min | Date | — | The earliest date that can be chosen |
max | Date | — | The latest date that can be chosen |
locale | string | — | The locale of the names and formats; the device's by default |
weekStartsOn | number | — | The first day of the week, 0 Sunday to 6 Saturday; the locale's by default |
hour12 | boolean | — | A 12-hour clock with AM and PM; the locale's by default |
placeholder | string | "Select date" / "Select time" | Shown while there is no value |
disabled | boolean | false | Dims it and takes no presses |
aria-label | string | — | Its name for a screen reader, a row's label |
dateTitle | string | "Select date" | Android: the date dialog's header; the iOS popover's name |
timeTitle | string | "Select time" | Android: the time dialog's header; the iOS popover's name |
cancelLabel | string | "Cancel" | Android: the dialog's Cancel |
okLabel | string | "OK" | Android: the dialog's OK |
timeLabel | string | "Time" | The row under an inline calendar with the time |
testID | string | — | Test id; the parts add -date, -time, -popover, -dialog, -calendar, -day-N |
style | StyleProp<ViewStyle> | — | Style of the picker's view |