Skip to content

Input Date Picker contains a calendar component within an input used for choosing a day of a month.

Overview

Input Date Picker is an input-driven component containing the Date Picker.

Usage

  • Choosing a day
  • Choosing a range of days

Sample

Accessibility

Keyboard navigation

For more detailed keyboard navigation, visit the Date Picker's keyboard navigation.

KeyFunction
TabMoves focus in and out of the component.
Tab and ShiftMoves focus in and out of the component.
Arrow downOpens and shifts focus to the calcite-date-picker component.
EscWhen the calcite-date-picker component is open, closes the component and shifts focus back to the calcite-input-date-picker.

API reference

Properties

PropertyAttributeDescriptionTypeDefault
calendarscalendarsWhen range is true, specifies the number of calendars displayed.1 | 22
disableddisabledWhen true, prevents interaction and decreases the component's opacity.booleanfalse
flipPlacementsSpecifies the component's fallback placement for slotted content when it's initial or specified placement has insufficient space available.FlipPlacement[]
focusTrapDisabledfocus-trap-disabledWhen true, prevents focus trapping.booleanfalse
formformSpecifies the id of the component's associated form. When not set, the component is associated with its ancestor form element, if one exists.string
headingLevelheading-levelSpecifies the heading level number of the component's heading for proper document structure, without affecting visual styling.HeadingLevel
labellabelSpecifies an accessible label for the component.string
labelTextlabel-textSpecifies the component's label text.string
layoutlayoutDefines the component's layout."horizontal" | "vertical""horizontal"
maxmaxWhen the component resides in a form, specifies the latest allowed date ("yyyy-mm-dd").string
maxAsDateSpecifies the latest allowed date as a full date object.Date
messageOverridesOverrides individual strings used by the component.Record<string, unknown> | undefined
minminWhen the component resides in a form, specifies the earliest allowed date ("yyyy-mm-dd").string
minAsDateSpecifies the earliest allowed date as a full date object.Date
monthStylemonth-styleSpecifies the component's month style."abbreviated" | "wide""wide"
namenameSpecifies the name of the component. Required to pass the component's value on form submission.string
numberingSystemnumbering-systemSpecifies the Unicode numeral system used by the component for localization. This property cannot be dynamically changed.NumberingSystem
openopenWhen true, displays the calcite-date-picker component.booleanfalse
overlayPositioningoverlay-positioningSpecifies the type of positioning to use for overlaid content, where: "absolute" works for most cases - positioning the component inside of overflowing parent containers, which affects the container's layout, and "fixed" is used to escape an overflowing parent container, or when the reference element's position CSS property is "fixed".OverlayPositioning"absolute"
placementplacementDetermines the calcite-date-picker's placement relative to the input.MenuPlacement"bottom-start"
proximitySelectionDisabledproximity-selection-disabledWhen true, disables the default behavior on the third click of narrowing or extending the range. Instead starts a new range.booleanfalse
rangerangeWhen true, activates a range for the component.booleanfalse
readOnlyread-onlyWhen true, the component's value can be read, but controls are not accessible and the value cannot be modified.booleanfalse
requiredrequiredWhen true and the component resides in a form, the component must have a value in order for the form to submit.booleanfalse
scalescaleSpecifies the size of the component."s" | "m" | "l""m"
statusstatusSpecifies the input field's status, which determines message and icons.Status"idle"
topLayerDisabledtop-layer-disabledWhen true and the component is open, disables top layer placement. Only set this if you need complex z-index control or if top layer placement causes conflicts with third-party components.booleanfalse
validationIconvalidation-iconSpecifies the validation icon to display under the component.IconName | boolean
validationMessagevalidation-messageSpecifies the validation message to display under the component.string
validityread-onlyThe component's current validation state.MutableValidityState
valuevalueSelected date as a string in ISO format ("yyyy-mm-dd").string | string[]
valueAsDateThe component's value as a full date object.Date | Date[]

Slots

NameDescription
label-contentA slot for rendering content next to the component's labelText.

Styles

NameDescription
--calcite-input-date-picker-actions-icon-colorSpecifies the component's actions icon color.
--calcite-input-date-picker-actions-icon-color-hoverSpecifies the component's actions icon color on hover.
--calcite-input-date-picker-background-colorSpecifies the component's input background color.
--calcite-input-date-picker-border-colorSpecifies the component's input border color.
--calcite-input-date-picker-calendar-actions-background-colorSpecifies the background color of the component's calendar actions.
--calcite-input-date-picker-calendar-actions-background-color-hoverSpecifies the background color of the component's calendar actions when hovered.
--calcite-input-date-picker-calendar-actions-background-color-pressSpecifies the background color of the component's calendar actions when pressed.
--calcite-input-date-picker-calendar-actions-text-colorSpecifies the text color of the component's calendar actions.
--calcite-input-date-picker-calendar-actions-text-color-pressSpecifies the text color of the component's calendar actions when pressed.
--calcite-input-date-picker-calendar-border-colorSpecifies the border color of the component's calendar.
--calcite-input-date-picker-calendar-corner-radiusSpecifies the corner radius of the component's calendar.
--calcite-input-date-picker-calendar-current-day-text-colorSpecifies the text color of the component's calendar current day element.
--calcite-input-date-picker-calendar-day-background-colorSpecifies the background color of the component's calendar day elements.
--calcite-input-date-picker-calendar-day-background-color-hoverSpecifies the background color of the component's calendar day elements when hovered.
--calcite-input-date-picker-calendar-day-current-text-color
deprecated Use --calcite-input-date-picker-calendar-current-day-text-color. Specifies the text color of current day of the component's date-picker.
--calcite-input-date-picker-calendar-day-range-background-colorSpecifies the background color of the component's calendar selected day range.
--calcite-input-date-picker-calendar-day-range-text-colorSpecifies the text color of the component's calendar selected day range.
--calcite-input-date-picker-calendar-day-text-color-selectedSpecifies the text color of component's calendar selected day.
--calcite-input-date-picker-calendar-day-outside-range-background-color-hoverSpecifies the background color of the component's calendar day elements outside the current range when hovered.
--calcite-input-date-picker-calendar-day-outside-range-text-color-hoverSpecifies the text color of the component's calendar day elements outside the current range when hovered.
--calcite-input-date-picker-calendar-day-text-colorSpecifies the text color of the component's calendar day elements.
--calcite-input-date-picker-calendar-day-text-color-hoverSpecifies the text color of the component's calendar day elements when hovered.
--calcite-input-date-picker-calendar-selected-background-colorSpecifies the background color of the component's calendar selected day.
--calcite-input-date-picker-calendar-shadowSpecifies the component's calendar shadow.
--calcite-input-date-picker-calendar-icon-colorSpecifies the component's calendar icon color.
--calcite-input-date-picker-calendar-icon-color-hoverSpecifies the component's calendar icon color when hovered.
--calcite-input-date-picker-calendar-month-select-text-colorSpecifies the text color of the component's calendar selected month.
--calcite-input-date-picker-calendar-range-divider-colorWhen range is true, specifies the divider color between the component's calendars.
--calcite-input-date-picker-calendar-text-colorSpecifies the text color of the component's calendar week, year & suffix.
--calcite-input-date-picker-corner-radiusSpecifies the component's input corner radius.
--calcite-input-date-picker-divider-colorWhen range is true, specifies the component's divider color between two inputs.
--calcite-input-date-picker-icon-colorSpecifies the component's input icon color.
--calcite-input-date-picker-placeholder-text-colorSpecifies the component's input placeholder text color.
--calcite-input-date-picker-shadowSpecifies the component's input shadow.
--calcite-input-date-picker-text-colorSpecifies the component's input text color.

Events

NameDescriptionBehavior
calciteInputDatePickerBeforeCloseFires when the component is requested to be closed and before the closing transition begins.bubblescomposed
calciteInputDatePickerBeforeOpenFires when the component is added to the DOM but not rendered, and before the opening transition begins.bubblescomposed
calciteInputDatePickerChangeFires when the component's value changes.bubblescomposed
calciteInputDatePickerCloseFires when the component is closed and animation is complete.bubblescomposed
calciteInputDatePickerOpenFires when the component is opened and animation is complete.bubblescomposed

Methods

NameDescriptionSignature
componentOnReadyCreate a promise that resolves once component is fully loaded.componentOnReady(): Promise<this>
repositionUpdates the component's position.reposition(delayed?: boolean): Promise<void>
setFocusSets focus on the component.setFocus(options?: FocusOptions): Promise<void>

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.