Capture time range from user


import { useState } from 'react';
import dayjs from 'dayjs';
import { TimeRangeInput } from '@mantine/dates';
function Demo() {
const now = new Date();
const then = dayjs(now).add(30, 'minutes').toDate();
const [value, setValue] = useState([now, then]);
return <TimeRangeInput label="Appointment time" value={value} onChange={setValue} clearable />;

With seconds

<TimeRangeInput withSeconds />

TimeRangeInput props

TimeRangeInput component uses the same props as TimeInput component, With differences in value, onChange, defaultValue and some additional props like labelSeparator.

Accessibility and usability

Provide hours, minutes and seconds labels to make inputs visible to screen reader:

<TimeRangeInput hoursLabel="Hours" minutesLabel="Minutes" seconds="Seconds" />
Build fully functional accessible web applications faster than ever
Your feedback is most valuable contribution to the project, please share how you use Mantine, what features are missing and what is done good
Leave feedback