Skip to main content
This subpath needs the optional react-day-picker peer dependency: pnpm add react-day-picker. See Subpath exports.

Examples

Default

With Disabled Dates

Compact Single

Single Selection

DateRangePanel — Default

DateRangePanel — Custom Range Applied

DateRangePanel — Preset Applied

Props

DatePicker

A calendar date picker supporting single-date and date-range selection with optional side-by-side month display and footer action buttons. Built on top of react-day-picker — all DayPickerProps (except numberOfMonths) are forwarded. Takes no props of its own beyond the standard attributes of the element it renders.

DateRangePanel

A list of date range presets, with a “Custom range” row that swaps to a one-month calendar when customRangeLabel is given. A pointer click, Space or Enter on a row picks it. A preset applies at once, and a custom range applies on Apply, with Cancel returning to the list. It always opens on the list, even when a custom range is applied, so a preset stays reachable. The arrow keys only move focus between rows and never pick one, so a keyboard user can reach a row without applying it. It renders no popover, so it can sit inside a popover or a phone sheet. The caller maps preset ids to dates.
string
required
Accessible name of the preset list. Translated by the caller.
(value: DateRangeValue) => void
required
Called with { type: "preset", presetId } as soon as a preset row is picked by click, Space or Enter, including the current one, and with { type: "custom", range } when Apply is clicked. Arrow keys move focus without calling it.
readonly DateRangePreset[]
required
Preset rows, in display order.
DateRangeValue
required
The applied selection. A custom value checks the Custom range row. Picking that row opens the calendar on the applied range.
string
default:"Apply"
Label of the Apply button.
DateRangeCalendarProps
Bounds, locale and first weekday for the calendar.
string
default:"Cancel"
Label of the Cancel button.
string
Additional CSS class name for the root element.
string
Label of the last row, which opens the calendar. Omit to offer presets only. Translated by the caller.
(() => void)
Called after Cancel drops the draft range and the panel returns to the preset list.

DateRangePicker

A DateRangePanel in a popover under a caller-supplied trigger. The popover closes after a preset pick, Apply and Cancel. Closing it any other way drops an unapplied range.
string
required
Accessible name of the popover dialog and of the preset list inside it. Translated by the caller.
ReactElement<unknown, string | JSXElementConstructor<any>>
required
The trigger element, rendered as the popover trigger. It shows no value, so the caller owns its label.
(value: DateRangeValue) => void
required
Called with { type: "preset", presetId } as soon as a preset row is picked by click, Space or Enter, including the current one, and with { type: "custom", range } when Apply is clicked. Arrow keys move focus without calling it.
readonly DateRangePreset[]
required
Preset rows, in display order.
DateRangeValue
required
The applied selection. A custom value checks the Custom range row. Picking that row opens the calendar on the applied range.
string
default:"Apply"
Label of the Apply button.
DateRangeCalendarProps
Bounds, locale and first weekday for the calendar.
string
default:"Cancel"
Label of the Cancel button.
string
Label of the last row, which opens the calendar. Omit to offer presets only. Translated by the caller.
(() => void)
Called after Cancel drops the draft range and the panel returns to the preset list.

Exported types

Also exported from @fanvue/ui/date-picker: DatePickerOwnProps, DatePickerProps, DatePickerSize, DatePickerVariant, DateRange, DateRangePanelProps, DateRangePickerProps, DateRangePreset, DateRangeValue.
Setup: Installation · Theming · Subpath exports