Skip to content
Components

Date picker

A form element used to select a single or a range of dates.
Mon
Tue
Wed
Thu
Fri
Sat
Sun

Features

  • Supports range selection.
  • Pick days, months, years or even decades.
  • Highly customisable.

When to use

At Pleo, we almost always use the date picker with the prop showNeighboringMonth. We'll likely make this the default variation soon.

Examples

Range

Show code
<DatePicker onChange={() => {}} selectRange />

Allow partial range

In some cases, you may want to allow users to select either a single date or a range of dates. This can be achieved by allowing partial range.

<DatePicker
    selectRange
    allowPartialRange
    onChange={() => {
        // Will now also be called when the first date is selected
    }}
/>

Two months

Show code
<DatePicker onChange={() => {}} showDoubleView />

Week numbers

Show code
<DatePicker onChange={() => {}} showWeekNumbers />

Disabled dates

Show code
<DatePicker
    onChange={() => {}}
    tileDisabled={({date}) => date.getDay() === 0 || date.getDay() === 6}
/>
  • Date input: Enable users to input a date — either in a textfield or with a date picker.
Didn't find what you were looking for?
Edit this page