A date range field where the user types a start and an end date or selects a range in a calendar. The calendar opens in a dropdown or in a dialog.

Slots
prefix — Renders content before the input (single input).
prefix-start — Renders content before the start input (two inputs).
prefix-end — Renders content before the end input (two inputs).
suffix — Renders content after the input (single input).
suffix-start — Renders content after the start input (two inputs).
suffix-end — Renders content after the end input (two inputs).
helper-text — Renders content below the input.
bad-input — Renders content when the range includes a date in the `disabledDates` ranges.
value-missing — Renders content when the required validation fails.
range-overflow — Renders content when the max validation fails.
range-underflow — Renders content when the min validation fails.
custom-error — Renders content when a custom message is set with `setCustomValidity()`.
invalid — Renders content when the component is in invalid state (validity.valid = false).
title — Renders content in the calendar title. It applies only in `dialog` mode.
header-date — Renders content instead of the current range in the calendar header. It applies only in `dialog` mode.
clear-icon — Renders the icon of the clear button.
clear-icon-start — Renders the icon of the clear button for the start input (two inputs).
clear-icon-end — Renders the icon of the clear button for the end input (two inputs).
calendar-icon — Renders the icon/content for the calendar picker.
calendar-icon-start — Renders the icon/content for the calendar picker for the start input (two inputs).
calendar-icon-end — Renders the icon/content for the calendar picker for the end input (two inputs).
calendar-icon-open — Renders the icon/content for the picker in open state.
calendar-icon-open-start — Renders the icon/content for the picker in open state for the start input (two inputs).
calendar-icon-open-end — Renders the icon/content for the picker in open state for the end input (two inputs).
actions — Renders content in the action part of the picker in open state.
separator — Renders the separator element between the two inputs.
CSS Parts
inputs — The wrapper of the start input, the separator and the end input (two inputs).
separator — The separator element between the two inputs.
ranges — The wrapper that renders the custom and predefined ranges.
label — The label wrapper that renders content above the target input.
calendar-icon — The calendar icon wrapper for closed state (single input).
calendar-icon-start — The calendar icon wrapper for closed state for the start input (two inputs).
calendar-icon-end — The calendar icon wrapper for closed state for the end input (two inputs).
calendar-icon-open — The calendar icon wrapper for opened state (single input).
calendar-icon-open-start — The calendar icon wrapper for opened state for the start input (two inputs).
calendar-icon-open-end — The calendar icon wrapper for opened state for the end input (two inputs).
clear-icon — The clear icon wrapper (single input).
clear-icon-start — The clear icon wrapper for the start input (two inputs).
clear-icon-end — The clear icon wrapper for the end input (two inputs).
actions — The wrapper for the custom actions area.
input — The native input element.
prefix — The prefix wrapper.
suffix — The suffix wrapper.
helper-text — The helper-text wrapper that renders content below the target input.
header — The calendar header element.
header-title — The calendar header title element.
header-date — The calendar header date element.
calendar-content — The calendar content element which contains the views and navigation elements.
navigation — The calendar navigation container element.
months-navigation — The calendar months navigation button element.
years-navigation — The calendar years navigation button element.
years-range — The calendar years range element.
navigation-buttons — The calendar navigation buttons container.
navigation-button — The calendar previous/next navigation button.
days-view-container — The calendar days view container element.
days-view — The calendar days view element.
months-view — The calendar months view element.
years-view — The calendar years view element.
days-row — The calendar days row element.
months-row — The calendar months row element.
years-row — The calendar years row element.
calendar-label — The calendar week header label element.
calendar-label-inner — The calendar week header label inner element.
week-number — The calendar week number element.
week-number-inner — The calendar week number inner element.
date — The calendar date element.
date-inner — The calendar date inner element.
first — The calendar first selected date element in range selection.
last — The calendar last selected date element in range selection.
inactive — The calendar inactive date element.
hidden — The calendar hidden date element.
weekend — The calendar weekend date element.
range — The calendar range selected element.
special — The calendar special date element.
disabled — The calendar disabled date element.
single — The calendar single selected date element.
preview — The calendar range selection preview date element.
month — The calendar month element.
month-inner — The calendar month inner element.
year — The calendar year element.
year-inner — The calendar year inner element.
selected — The calendar selected state for element(s). Applies to date, month and year elements.
current — The calendar current state for element(s). Applies to date, month and year elements.
dialog-base — The base of the dialog in dialog mode. Style the backdrop with `::part(dialog-base)::backdrop`.
title — The title of the dialog in dialog mode.
footer — The footer of the dialog in dialog mode, which holds the Cancel and Done buttons.

The date that the calendar shows and highlights. Without it, the calendar starts at the value, or at the current date when there is no value.

activeDate: Date

The custom date ranges that the picker shows as chips. A click on a chip selects its range.

customRanges: CustomDateRange[]

The date ranges that the user cannot select in the calendar. A value that includes one of these dates is invalid.

disabledDates: DateRangeDescriptor[]

The format of the value while the input does not have focus. Without it, the input uses inputFormat when set, else the display format of the locale.

displayFormat: string

The orientation of the calendar header. It applies only in dialog mode.

headerOrientation: CalendarHeaderOrientation

Whether the calendar hides its header. In dropdown mode, the header is always hidden.

hideHeader: boolean

Whether the calendar hides the dates that do not belong to the current month.

hideOutsideDays: boolean

The date format of the input while the user edits the value. Without it, the input uses the input format of the locale.

inputFormat: string

The label of the picker.

label: string

The label of the end input.

labelEnd: string

The label of the start input.

labelStart: string
locale: string

The maximum value required for the picker to remain valid. The calendar disables the dates after it.

max: Date | null

The minimum value required for the picker to remain valid. The calendar disables the dates before it.

min: Date | null

Whether the calendar opens in a dropdown or in a modal dialog. In dialog mode, the user cannot type in the input.

mode: PickerMode

Whether the user cannot type in the input. The user can still select a date in the calendar.

nonEditable: boolean

The orientation of the multiple months displayed in the calendar's days view.

orientation: ContentOrientation

Whether the control has an outlined appearance.

outlined: boolean

The placeholder text of the control (single input).

placeholder: string

The placeholder text of the end input.

placeholderEnd: string

The placeholder text of the start input.

placeholderStart: string

The prompt symbol to use for unfilled parts of the mask.

prompt: string

Whether the control is read-only. The user cannot change the value or open the calendar.

readOnly: boolean
resourceStrings: TGet

Whether the calendar shows the week numbers.

showWeekNumbers: boolean

The date ranges that the calendar marks as special.

specialDates: DateRangeDescriptor[]

Whether the picker shows chips with predefined ranges.

usePredefinedRanges: boolean

Whether the picker shows the start and the end date in two separate inputs.

useTwoInputs: boolean

The value of the picker: a range with a start and an end date.

value: DateRangeValue | null

The number of months displayed in the calendar: 1 or 2.

visibleMonths: number

The number of months displayed in the calendar.

visibleMonths: number

The first day of the week in the calendar.

weekStart: WeekDays

Removes focus from the picker.

blur(): void

Returns void

Clears the value and the input text of the picker.

clear(): void

Returns void

Sets focus on the picker.

focus(options: FocusOptions): void

Parameters

  • options: FocusOptions

Returns void

Sets the value of the picker to value. It does not emit events.

select(value: DateRangeValue | null): void

Parameters

Returns void

Emitted when the user commits a change to the value.

onChange(args: CustomEvent<DateRangeValue | null>): void

Parameters

Returns void

Emitted after a user interaction closes the calendar.

onClosed(args: CustomEvent<void>): void

Parameters

Returns void

Emitted before a user interaction closes the calendar. Cancelable.

onClosing(args: CustomEvent<void>): void

Parameters

Returns void

Emitted when the user types in an input.

onInput(args: CustomEvent<DateRangeValue | null>): void

Parameters

Returns void

Emitted after a user interaction opens the calendar.

onOpened(args: CustomEvent<void>): void

Parameters

Returns void

Emitted before a user interaction opens the calendar. Cancelable.

onOpening(args: CustomEvent<void>): void

Parameters

Returns void