Skip to content
THE COMPONENT LIBRARY
Skip to content

Component reference

DateRangePicker

Pick arrival and departure dates for a reservation.

Preview

Live preview

Changes apply to this preview only.

Stay dates
Accommodation4 nights

Wed, Oct 21 → Sun, Oct 25 · check-in from 3 pm

Width adapts to the available space

More examples

Different configurations and compositions using the real Pimolu API. Each preview runs independently and follows the site appearance.

Basic

The first click sets the start, the second completes the range and closes the panel. The footer keeps asking for the missing endpoint until then.

Open preview

Presets

Presets are ordinary data: a label and a range. Choosing a complete preset closes the panel.

Open preview

Single month

numberOfMonths=1 keeps the panel narrow for mobile or dense forms. The range model is identical.

Open preview

Usage

Validate ordering and availability in the application; avoid UTC conversions that shift calendar days.

API reference

Generated from the public TypeScript declarations. Native HTML attributes are inherited where the component extends them; this reference includes Pimolu props and selected common native attributes.

PimoluDateRangePreset

Type source
PimoluDateRangePreset public API
NameTypeDefaultDescription
labelRequiredstring—Visible label of the preset button.
rangeRequiredPimoluDateRange—Range applied when the preset is chosen.
labelRequired

string

No default extracted.

Visible label of the preset button.

rangeRequired

PimoluDateRange

No default extracted.

Range applied when the preset is chosen.

PimoluDateRangePickerProps

Type source
PimoluDateRangePickerProps public API
NameTypeDefaultDescription
idstring | undefined—Id of the trigger button. Generated when omitted.
namestring | undefined—Name of the hidden start-date input submitted with the form.
valuePimoluDateRange | undefined—Controlled range. Omit to let the picker own it.
defaultValuePimoluDateRange | undefined—Initial range when uncontrolled.
onChange((range: PimoluDateRange) => void) | undefined—Called with the next range, including the empty range when cleared.
placeholderstring | undefined"Select date range"Text shown while no range is selected. Defaults to "Select date range".
labelstring | undefined—Visible label, also used as the trigger's accessible name.
minDate | undefined—Earliest selectable day, inclusive.
maxDate | undefined—Latest selectable day, inclusive.
disabledDatesPimoluDisabledDates | undefined—Dates that cannot be selected, as a list or a predicate.
presetsreadonly PimoluDateRangePreset[] | undefined—Shortcuts shown beside the calendars.
numberOfMonths1 | 2 | undefined2Number of consecutive months. Defaults to 2.
disabledboolean | undefinedfalseNever open the calendars.
readOnlyboolean | undefinedfalseKeep the value visible and focusable but not editable.
requiredboolean | undefinedfalseMarks the field as required and shows the required marker.
clearableboolean | undefinedtrueShow the clear button when a range is selected. Defaults to true.
fullWidthboolean | undefinedfalseStretch the field to the parent width.
localestring | undefined"en-US"BCP 47 locale for display and calendar labels. Defaults to "en-US".
weekStartsOn0 | 1 | undefined0First day of the week: 0 = Sunday, 1 = Monday. Defaults to 0.
clearLabelstring | undefined—Accessible label for the clear button.
classNamestring | undefined—Class applied to the outer field.
aria-labelstring | undefined—Accessible name for the trigger when no visible label is used.
id

string | undefined

No default extracted.

Id of the trigger button. Generated when omitted.

name

string | undefined

No default extracted.

Name of the hidden start-date input submitted with the form.

value

PimoluDateRange | undefined

No default extracted.

Controlled range. Omit to let the picker own it.

defaultValue

PimoluDateRange | undefined

No default extracted.

Initial range when uncontrolled.

onChange

((range: PimoluDateRange) => void) | undefined

No default extracted.

Called with the next range, including the empty range when cleared.

placeholder

string | undefined

Default: "Select date range"

Text shown while no range is selected. Defaults to "Select date range".

label

string | undefined

No default extracted.

Visible label, also used as the trigger's accessible name.

min

Date | undefined

No default extracted.

Earliest selectable day, inclusive.

max

Date | undefined

No default extracted.

Latest selectable day, inclusive.

disabledDates

PimoluDisabledDates | undefined

No default extracted.

Dates that cannot be selected, as a list or a predicate.

presets

readonly PimoluDateRangePreset[] | undefined

No default extracted.

Shortcuts shown beside the calendars.

numberOfMonths

1 | 2 | undefined

Default: 2

Number of consecutive months. Defaults to 2.

disabled

boolean | undefined

Default: false

Never open the calendars.

readOnly

boolean | undefined

Default: false

Keep the value visible and focusable but not editable.

required

boolean | undefined

Default: false

Marks the field as required and shows the required marker.

clearable

boolean | undefined

Default: true

Show the clear button when a range is selected. Defaults to true.

fullWidth

boolean | undefined

Default: false

Stretch the field to the parent width.

locale

string | undefined

Default: "en-US"

BCP 47 locale for display and calendar labels. Defaults to "en-US".

weekStartsOn

0 | 1 | undefined

Default: 0

First day of the week: 0 = Sunday, 1 = Monday. Defaults to 0.

clearLabel

string | undefined

No default extracted.

Accessible label for the clear button.

className

string | undefined

No default extracted.

Class applied to the outer field.

aria-label

string | undefined

No default extracted.

Accessible name for the trigger when no visible label is used.

Accessibility

  • Label the range, make both endpoints understandable and verify clear/open/close focus behavior.
Read the accessibility guide →