A calendar that lets the user select a single date, multiple dates or a date range.
- Slots
-
title— Renders the title of the calendar header. -
header-date— Renders content instead of the current date/range in the calendar header.
- CSS Parts
-
header— The header element of the calendar. -
header-title— The header title element of the calendar. -
header-date— The header date element of the calendar. -
content— The content element which contains the views and navigation elements of the calendar. -
content-vertical— The content element which contains the views and navigation elements of the calendar in vertical orientation. -
navigation— The navigation container element of the calendar. -
picker-dates— The container of the month and year navigation buttons, or of the years range. -
months-navigation— The months navigation button element of the calendar. -
years-navigation— The years navigation button element of the calendar. -
years-range— The years range element of the calendar. -
navigation-buttons— The navigation buttons container of the calendar. -
navigation-button— Previous/next navigation button of the calendar. -
vertical— Added to the navigation-button part when the orientation is `vertical`. -
days-view-container— The days view container element of the calendar. -
days-view— Days view element of the calendar. -
months-view— The months view element of the calendar. -
years-view— The years view element of the calendar. -
days-row— Days row element of the calendar. -
months-row— Months row element of the calendar. -
years-row— Years row element of the calendar. -
label— Week header label element of the calendar. -
label-inner— Week header label inner element of the calendar. -
week-number— Week number element of the calendar. -
week-number-inner— Week number inner element of the calendar. -
date— Date element of the calendar. -
date-inner— Date inner element of the calendar. -
first— The first selected date element of the calendar in range selection. Also applies to the week numbers header cell. -
last— The last selected date element of the calendar in range selection. Also applies to the week number of the last rendered week. -
inactive— Inactive date element of the calendar. -
hidden— Hidden date element of the calendar. -
weekend— Weekend date element of the calendar. -
range— Range selected element of the calendar. -
special— Special date element of the calendar. -
disabled— Disabled date element of the calendar. -
single— Single selected date element of the calendar. -
preview— Range selection preview date element of the calendar. -
month— Month element of the calendar. -
month-inner— Month inner element of the calendar. -
year— Year element of the calendar. -
year-inner— Year inner element of the calendar. -
selected— Indicates selected state. Applies to date, month and year elements of the calendar. -
current— Indicates current state. Applies to date, month and year elements of the calendar.
Properties
Section titled "Properties"activeDate
Section titled "activeDate"The date that the calendar shows and highlights. It changes when the user navigates. Without it, the calendar starts at its value, or at the current date when there is no value.
activeDate: Date activeView
Section titled "activeView"The active view of the calendar: days, months or years.
activeView: CalendarActiveView disabledDates
Section titled "disabledDates"The date ranges that the user cannot select.
disabledDates: DateRangeDescriptor[] | undefined formatOptions
Section titled "formatOptions"The options used to format the months and the weekdays in the calendar views.
formatOptions: Pick<DateTimeFormatOptions, "month" | "weekday"> headerOrientation
Section titled "headerOrientation"The orientation of the calendar header.
headerOrientation: CalendarHeaderOrientation hideHeader
Section titled "hideHeader"Whether the calendar hides its header.
In multiple selection mode, the header is always hidden.
hideHeader: boolean hideOutsideDays
Section titled "hideOutsideDays"Whether the calendar hides the dates that do not belong to the current month.
hideOutsideDays: boolean orientation
Section titled "orientation"The orientation of the calendar months when more than one month is being shown.
orientation: ContentOrientation selection
Section titled "selection"The selection mode of the calendar: single, multiple or range.
A change after the first render clears the value and the values.
selection: CalendarSelection showWeekNumbers
Section titled "showWeekNumbers"Whether the calendar shows the week numbers.
showWeekNumbers: boolean specialDates
Section titled "specialDates"The date ranges that the calendar marks as special.
specialDates: DateRangeDescriptor[] | undefined values
Section titled "values"The values of the calendar in multiple and range selection modes.
values: Date[] visibleMonths
Section titled "visibleMonths"The number of months displayed in the days view.
visibleMonths: number Events
Section titled "Events"onChange
Section titled "onChange"Emitted when the user changes the value of the calendar.
onChange(args: CustomEvent<Date | Date[]>): void Parameters
- args:
CustomEvent<Date | Date[]>