Single Mode

May 2, 2026 ยท View on GitHub

When the mode prop is set to "single", only one date can be selected at a time.

<DayPicker mode="single" />

Single Mode Props

Prop NameTypeDescription
selectedDate | undefinedThe selected date.
onSelectOnSelectHandler<Date | undefined>Event callback when a date is selected.
requiredbooleanMake the selection required.

Controlled Selections

Use the selected and onSelect props to control the selected date:

export function App() {
  const [selected, setSelected] = React.useState<Date | undefined>();
  return <DayPicker mode="single" selected={selected} onSelect={setSelected} />;
}

Required Selection

By setting the required prop, DayPicker ensures that the user cannot unselect the selected date.

<DayPicker mode="single" required />