apps/mantine.dev/src/pages/dates/time-input.mdx
import { TimeInputDemos } from '@docs/demos'; import { Layout } from '@/layout'; import { MDX_DATA } from '@/mdx';
export default Layout(MDX_DATA.TimeInput);
The TimeInput component is based on the native input[type="time"] element and does not support
most advanced features like choosing time format or custom dropdown with time select. If you need
more features, use the TimePicker component instead.
TimeInput features/limitations:
input[type="time"] elementimport { useState } from 'react';
import { TimeInput } from '@mantine/dates';
function Demo() {
const [value, setValue] = useState('');
return (
<TimeInput
value={value}
onChange={(event) => setValue(event.currentTarget.value)}
/>
);
}
You can show the browser picker by calling the showPicker method of the input element.
Note that some browsers (desktop Safari) do not support this feature and the
method will do nothing.
<GetElementRef component="TimeInput" refType="input" package="@mantine/dates" />
<InputAccessibility component="TimeInput" packageName="@mantine/dates" />