Skip to content
THE COMPONENT LIBRARY
Skip to content

Component reference

DatePicker

Single-day selection with a calendar, locale and form integration.

Preview

Live preview

Changes apply to this preview only.

Loading the interactive example?

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

A controlled value with min/max and Sundays disabled. The clear button appears as soon as a date is selected.

Open preview

Locale and week start

The trigger and the calendar share the locale; weekStartsOn controls the first grid column.

Open preview

States

Empty, required, disabled and read-only fields. Read-only keeps the value focusable without opening the calendar.

Open preview

Usage

value/onChange uses Date or null. Set locale and weekStartsOn deliberately; min and max are inclusive calendar-day limits.

Use name for the hidden form input, and use clearable to control clearing. Treat the chosen value as a calendar day: converting local midnight to UTC can change its date.

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.

PimoluDatePickerProps

Type source
PimoluDatePickerProps public API
NameTypeDefaultDescription
idstring | undefined—Id of the trigger button. Generated when omitted.
namestring | undefined—Name of the hidden input submitted with the form.
valueDate | null | undefined—Controlled value. Omit to let the picker own it; `null` is empty.
defaultValueDate | null | undefinednullInitial value when uncontrolled.
onChange((value: Date | null) => void) | undefined—Called with the selected day, or `null` when cleared.
placeholderstring | undefined"Select date"Text shown while no date is selected. Defaults to "Select date".
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.
disabledboolean | undefinedfalseNever open the calendar.
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 date 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 input submitted with the form.

value

Date | null | undefined

No default extracted.

Controlled value. Omit to let the picker own it; `null` is empty.

defaultValue

Date | null | undefined

Default: null

Initial value when uncontrolled.

onChange

((value: Date | null) => void) | undefined

No default extracted.

Called with the selected day, or `null` when cleared.

placeholder

string | undefined

Default: "Select date"

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

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.

disabled

boolean | undefined

Default: false

Never open the calendar.

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 date 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

  • Provide label or aria-label; retain an explicit name for the clear action.
  • Test calendar arrows, opening, closing and focus return. Communicate unavailable dates and validation in text.
Read the accessibility guide →