Skip to content

Date Range Picker

The date range picker let the user select a range of dates.

Basic usage

Press Enter to start editing

Uncontrolled vs. Controlled

The component can be uncontrolled or controlled

Uncontrolled picker

Controlled picker

Press Enter to start editing

Responsiveness

The date range picker component is designed to be optimized for the device it runs on.

  • The MobileNextDateRangePicker component works best for touch devices and small screens.
  • The DesktopNextDateRangePicker component works best for mouse devices and large screens.

By default, the NextDateRangePicker component renders the desktop version if the media query @media (pointer: fine) matches. This can be customized with the desktopModeMediaQuery prop.

There are certain caveats when testing pickers, please refer to this section for more information.

For mobile

For desktop

Responsive

Press Enter to start editing

Static mode

It is also possible to render any date range picker without the modal/popover and text field. This will enable building custom popover/modal containers.

April 2022
SMTWTFS
May 2022
SMTWTFS
Press Enter to start editing

Form props

The date range picker component can be disabled or read-only.

disabled

readOnly

Press Enter to start editing

Validation

You can find the documentation in the Validation page

Different number of months

Note that the calendars prop only works in desktop mode.

1 calendar

2 calendars

3 calendars

Press Enter to start editing

Custom input component

You can customize the rendering of the input with the Input component slot. Make sure to spread inputProps correctly to the custom input component.

Press Enter to start editing

Customized day rendering

The displayed days are customizable with the Day component slot. You can take advantage of the internal DateRangePickerDay component.

April 2022
SMTWTFS
May 2022
SMTWTFS
Press Enter to start editing

🚧 Pre-defined range shortcuts

Range shortcuts allows your users to select a commonly-used range in one click (eg: last week, last month, …)

🚧 Month range Picker

Month range picker allows setting date ranges by picking months only.

API

See the documentation below for a complete reference to all of the props and classes available to the components mentioned here.