Examples
Default
With Disabled Dates
Compact Single
Without Footer
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 — allDayPickerProps (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 whencustomRangeLabel 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.
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.The applied selection. A custom value checks the Custom range row. Picking that row opens the calendar on the applied range.
Label of the last row, which opens the calendar. Omit to offer presets only. Translated by the caller.
DateRangePicker
ADateRangePanel 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.
Accessible name of the popover dialog and of the preset list inside it. Translated by the caller.
The trigger element, rendered as the popover trigger. It shows no value, so the caller owns its label.
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.The applied selection. A custom value checks the Custom range row. Picking that row opens the calendar on the applied range.
Label of the last row, which opens the calendar. Omit to offer presets only. Translated by the caller.
Exported types
Also exported from@fanvue/ui/date-picker: DatePickerOwnProps, DatePickerProps, DatePickerSize, DatePickerVariant, DateRange, DateRangePanelProps, DateRangePickerProps, DateRangePreset, DateRangeValue.
Setup: Installation · Theming · Subpath exports