DatePicker
A pressable field that opens a bottom sheet with a month calendar. Fully controlled via value and onChange, with plain Date objects — no date library dependency.
Playground
Date
<DatePicker
label="Date"
value={value}
onChange={setValue}
/>
Basic usage
Date of birth
function DatePickerDemo() {
const [value, setValue] = useState<Date | undefined>(undefined);
return <DatePicker label="Date of birth" value={value} onChange={setValue} />;
}
Min / max date
Pass minDate/maxDate to disable dates outside a range.
Appointment
<DatePicker
label="Appointment"
value={value}
onChange={setValue}
minDate={new Date()}
maxDate={twoWeeksFromNow}
/>
Props
| Prop | Type | Default | Description |
|---|---|---|---|
value | Date | Currently selected date. | |
onChange | (date: Date) => void | Required. Called when a day is pressed. | |
minDate | Date | Disables days before this date. | |
maxDate | Date | Disables days after this date. | |
placeholder | string | 'Select a date…' | Text shown when nothing is selected. |
label | string | Label rendered above the field. | |
errorText | string | Helper text shown below the field when isInvalid. | |
isInvalid | boolean | false | Renders the field with an error border and shows errorText. |
isDisabled | boolean | false | Disables interaction and dims opacity. |
formatValue | (date: Date) => string | "Jan 1, 2026" format | Formats the selected date for the trigger field. |
selectedColor | TVajraColors | 'primary' | Fill color for the selected day and today's label. |
icon | TVajraIconComponent | Icon shown at the trailing edge of the trigger. Defaults to a plain 📅 glyph. | |
prevIcon | TVajraIconComponent | Previous-month icon. Defaults to a plain ‹ glyph. | |
nextIcon | TVajraIconComponent | Next-month icon. Defaults to a plain › glyph. | |
testID | string | Test identifier. |