Skip to main content

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​

PropTypeDefaultDescription
valueDateCurrently selected date.
onChange(date: Date) => voidRequired. Called when a day is pressed.
minDateDateDisables days before this date.
maxDateDateDisables days after this date.
placeholderstring'Select a date…'Text shown when nothing is selected.
labelstringLabel rendered above the field.
errorTextstringHelper text shown below the field when isInvalid.
isInvalidbooleanfalseRenders the field with an error border and shows errorText.
isDisabledbooleanfalseDisables interaction and dims opacity.
formatValue(date: Date) => string"Jan 1, 2026" formatFormats the selected date for the trigger field.
selectedColorTVajraColors'primary'Fill color for the selected day and today's label.
iconTVajraIconComponentIcon shown at the trailing edge of the trigger. Defaults to a plain 📅 glyph.
prevIconTVajraIconComponentPrevious-month icon. Defaults to a plain ‹ glyph.
nextIconTVajraIconComponentNext-month icon. Defaults to a plain › glyph.
testIDstringTest identifier.