Skip to content

TimeSelect

A time input component that uses a combobox for selecting time. Supports keyboard input in HH:mm format (with automatic formatting) and visual selection from a filtered list of available times.

import { useState } from 'react';
import { TimeSelect } from '@/react/time_select';
export const Demo = () => {
const [value, setValue] = useState<string>('');
return (
<TimeSelect
value={value}
onChange={setValue}
/>
);
};
NameTypeDefaultDescription
valuestringCurrent time value in HH:mm format (e.g., “14:30”)
onChange(value: string) => voidCallback when value changes
placeholderstring"HH:mm"Placeholder text
startstring"08:00"Start time in HH:mm format
endstring"19:00"End time in HH:mm format
stepstring"00:30"Time step in HH:mm format or minutes (e.g., “00:15” or “15”)
disabledbooleanfalseDisable the component
<TimeSelect
value={value}
onChange={setValue}
start="09:00"
end="17:00"
step="01:00"
placeholder="Business hours"
/>
<TimeSelect
value={value}
onChange={setValue}
start="00:00"
end="23:59"
step="00:15"
/>

The component automatically formats input as you type and filters the available time options based on the input. Times are generated from start to end with the specified step interval.