Skip to main content

Multiple Mode

Set the mode prop to "multiple" to enable the selection of multiple dates in DayPicker.

<DayPicker mode="multiple" />

Multiple Mode Props

Use the selected and onSelect props to manage the selected dates:

export function App() {
const [selected, setSelected] = React.useState<Date[] | undefined>();

return (
<DayPicker mode="multiple" selected={selected} onSelect={setSelected} />
);
}

Min and Max Dates

Use the min and max props to limit the number of selectable dates.

<DayPicker mode="multiple" min={2} max={5} />

Required Selection

By setting the required prop, DayPicker ensures that the selected dates cannot be unselected.

<DayPicker mode="multiple" required selected={[new Date()]} />