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 27Android
Native componentUIDatePicker (.compact, .inline, .wheels), SwiftUI DatePickerDatePicker and TimePicker of Material 3 (DatePickerDialog, TimePicker dial); spinner mode
CompactCapsules that open the calendar and the wheels in a popoverA row's value or an outlined field that opens the dialog; OK applies
InlineThe month's calendar in place, a Time row under itMaterial's calendar in place
WheelsWheels with a 32 band, turning round; rows out of range in a lighter toneSpinners between two lines, turning round, stopping at min and max

API

PropTypeDefaultDescription
valueDate | 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
minDate—The earliest date that can be chosen
maxDate—The latest date that can be chosen
localestring—The locale of the names and formats; the device's by default
weekStartsOnnumber—The first day of the week, 0 Sunday to 6 Saturday; the locale's by default
hour12boolean—A 12-hour clock with AM and PM; the locale's by default
placeholderstring"Select date" / "Select time"Shown while there is no value
disabledbooleanfalseDims it and takes no presses
aria-labelstring—Its name for a screen reader, a row's label
dateTitlestring"Select date"Android: the date dialog's header; the iOS popover's name
timeTitlestring"Select time"Android: the time dialog's header; the iOS popover's name
cancelLabelstring"Cancel"Android: the dialog's Cancel
okLabelstring"OK"Android: the dialog's OK
timeLabelstring"Time"The row under an inline calendar with the time
testIDstring—Test id; the parts add -date, -time, -popover, -dialog, -calendar, -day-N
styleStyleProp<ViewStyle>—Style of the picker's view