Components/Form/Calendar/CalendarPanel
Interactive docs page: https://wix-pages.com/design-system-documentation/#/component/calendarpanel
Calendar Panel component lets a user pick a date while providing a great overview of available selections.It's built using <Calendar/> and <CalendarPanelFooter/> components.
<Calendar/> instead<DatePicker/> insteadEmpower the user to quickly select a predefined range or date using `presets` prop.
Make the date selection secure by using `footer` prop which adds summarized date selection and confirmation actions.
Specify a number of months visible inside of a panel with `numOfMonths` prop.
By default panel displays 2 months at once. Display a single month only when presets are available.
Enable users to select the range of dates with `selectionMode` prop. It supports 2 values:
 - `day` (default) - lets to select 1 day.
 - `range` - lets to select any range of dates.
Let the user quickly change the month and year values with:
 - `showMonthDropdown` (default) - enables month selection dropdown.
 - `showYearDropdown` - enables year selection dropdown.
Control what dates the user can select with 2 props:
 - `filterDate` (default) - define what dates will be selectable.
 - `excludePastDates` - allow selecting only today and future dates.
Change the language using `locale` prop. Some languages will change the start of the week day and order of month and year. First Day of the week can be controlled manually with `firstDayOfWeek` prop.
Presets and footer actions aren't controlled by this and have to be translated manually.
When using `Yoshi 5` with `BM Flow` there's no need to use `locale` prop anymore. It is handled automatically.
Call it out from any action component such as <IconButton/>, <TextButton/>, <Button/>, etc. Use it to filter data and content.
| Name | Type | Default | Description |
|---|---|---|---|
autoFocus | boolean | true | Focuses the selected day automatically when the component mounts or updates. |
dataHook | string | — | Applies a data-hook HTML attribute that can be used in the tests. |
excludePastDates | boolean | — | Specifies whether past dates should be selectable or not. |
filterDate | (date: Date) => boolean | — | Specifies dates that are selectable. Only the dates that match defined criteria are available for a user to select. |
footer | (selectedDays: SelectedDaysType, submitDisabled: boolean) => void | — | Renders a panel footer. Pass <CalendarPanelFooter/> in all common cases. ({selectedDays, submitDisabled}) => void - selectedDays is the same as the CalendarPanel's value prop. submitDisabled is true when the current selectedDays isn't valid for submission. |
locale | "th" | "tr" | "id" | "fr" | "no" | "en" | "en-US" | "en-GB" | "en-AU" | "en-CA" | "ar" | "bg" | "ca" | "zh" | "zh-TW" | "zh-HK" | "zh-MO" | "cs" | "da" | "nl" | "fi" | "fr-CA" | "fr-CH" | "fr-BE" | "de" | "de-CH" | "de-AT" | "el" | "he" | "hi" | "hu" | "it" | "ja" | "ko" | "lt" | "ms" | "nb" | "nn" | "pl" | "pt-BR" | "pt" | "ro" | "ru" | "sk" | "sl" | "es" | "es-419" | "es-AR" | "es-MX" | "es-US" | "sv" | "tl" | "uk" | "vi" | DateFnsLocale | — | Specifies date picker instance locale. |
numOfMonths | number | 2 | Defines a number of months to display inside of a panel. |
onChange | (selectedDays: SelectedDaysType) => void | — | Defines a callback function which is called whenever the user selects a day or a date range in the calendar. |
onClose | (e: SyntheticEvent<Element, Event>) => void | — | Defines a callback function which is called whenever user press escape or click outside of the element. |
presets | PresetType[] | { selectedDays?: SelectedDaysType | undefined; id?: string | number | undefined; } | — | Defines an array of predefined calendar presets that are displayed as select items on the left side of a panel. |
ref | null | string | (instance: CalendarPanelImperativeActions | null) => void | RefObject<CalendarPanelImperativeActions> | — | Allows getting a ref to the component instance. Once the component unmounts, React will set ref.current to null (or call the ref with null if you passed a callback ref). |
selectionMode | "day" | "range" | — | Specifies if user can select a single day or a date range. |
shouldCloseOnSelect | boolean | — | Specifies whether calendar should close on a day selection. |
showMonthDropdown | boolean | — | Specifies whether to display a month selection dropdown inside of a calendar. |
showYearDropdown | boolean | — | Specifies whether to display a year selection dropdown inside of a calendar. |
value | string | Date | DateRangeType | — | Defines a selected date or date range. |
Import the driver matching your test environment:
| Method | Description |
|---|---|
calendarDriver | — |
presetsDropdownLayoutDriver | — |
isDropdownExists | — |
exists | Checks whether the component found with the given data hook. |
element | Gets the component root element. |
click | Clicks on the component root element. |
base | Returns UniDriver for the base element. |
Last updated: 30 October 2026