Skip to main content

TimePicker

A pressable field that opens a bottom sheet with hour/minute steppers and an AM/PM toggle. Fully controlled via value ({ hour, minute } in 24-hour form) and onChange.

Playground​

Time
<TimePicker
label="Time"
minuteStep={5}
value={value}
onChange={setValue}
/>

Basic usage​

Reminder time
function TimePickerDemo() {
const [value, setValue] = useState<{ hour: number; minute: number } | undefined>(undefined);

return <TimePicker label="Reminder time" value={value} onChange={setValue} />;
}

Minute step​

Meeting start
<TimePicker label="Meeting start" value={value} onChange={setValue} minuteStep={15} />

Props​

PropTypeDefaultDescription
value{ hour: number; minute: number }Currently selected time, 24-hour hour (0–23).
onChange(value: { hour: number; minute: number }) => voidRequired. Called when the hour, minute, or AM/PM changes.
minuteStepnumber1Minute increment the stepper moves by.
placeholderstring'Select a time…'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(value) => string"1:30 PM" formatFormats the selected time for the trigger field.
buttonBgTVajraColorsBackground color for the stepper +/βˆ’ buttons.
buttonColorTVajraColorsIcon color for the stepper +/βˆ’ buttons.
iconTVajraIconComponentIcon shown at the trailing edge of the trigger. Defaults to a plain πŸ• glyph.
testIDstringTest identifier.

Exports formatTime, timeFromDate, and timeToDate helpers for converting between { hour, minute } and Date.