Overview
Theapp-date-picker-input component combines a Material Design text field with a dropdown date picker. It provides a text input that opens a calendar picker when clicked or focused.
Installation
Import
Usage
Properties
Input-Specific Properties
Accessible label for the clear/reset icon button.
Label text displayed above/in the text field.
Helper text displayed below the input field.
Marks the field as required.
Disables the input field and picker.
Makes the input read-only (picker still works).
Inherited Properties
Inherits all properties from app-date-picker:value- Selected date (string)min- Minimum date (string)max- Maximum date (string)locale- Language code (string)firstDayOfWeek- First day of week (number)showWeekNumber- Show week numbers (boolean)weekNumberType- Week calculation type (string)startView- Initial view (string)disabledDates- Disabled dates (string)disabledDays- Disabled days (string)- All label properties
valueAsDate- Date object (readonly)valueAsNumber- Timestamp (readonly)
Material TextField Properties
Also inherits properties from Material Web Components TextField:outlined- Use outlined variant (boolean)helperPersistent- Always show helper text (boolean)validationMessage- Custom validation message (string)name- Form field name (string)autocapitalize- Auto-capitalization behavior (string)inputMode- Input mode hint (string)
Methods
Programmatically opens the date picker dropdown.
Closes the date picker dropdown.
Clears the selected date and resets the input field.
Material TextField Methods
Also inherits methods from Material TextField:layout()- Re-layout the text fieldsetCustomValidity(message)- Set custom validation message
Events
date-updated
Fires when the selected date changes.first-updated
Fires when the picker completes its first render.year-updated
Fires when the selected year changes in the year grid view.Menu Events
opened
Fires when the dropdown picker opens.closed
Fires when the dropdown picker closes.CSS Custom Properties
Inherits all CSS custom properties from app-date-picker plus Material TextField properties.Input-Specific
Color of the clear/reset icon button.
Material TextField Properties
Customize the text field appearance:--mdc-theme-primary- Primary color for labels and underline--mdc-theme-error- Error state color--mdc-text-field-fill-color- Background fill color--mdc-text-field-disabled-fill-color- Disabled background color--mdc-text-field-ink-color- Text color--mdc-text-field-label-ink-color- Label color--mdc-text-field-outlined-idle-border-color- Outlined variant border--mdc-text-field-outlined-hover-border-color- Outlined hover border
CSS Shadow Parts
Inherits all shadow parts from app-date-picker:header- Picker headerbody- Picker bodycalendar- Calendar containercalendar-day- Calendar day cellstoday- Today’s dateyear-grid- Year grid containeryear- Year buttons- And all other calendar parts
Keyboard Navigation
Input Field
- Click / Enter / Space - Open picker
- Escape - Close picker
- Tab - Move focus (closes picker if open)
Picker (when open)
- Arrow Keys - Navigate dates
- Enter / Space - Select date and close
- Escape - Close without selecting
- Tab - Close picker
Example: Form Integration
Example: Styled Input
TypeScript
Behavior Notes
- The input displays a formatted date (based on locale) while
valueremains in ISO format - The input is read-only by default; users select dates via the picker
- Clicking the clear icon resets the value to empty
- The picker lazy-loads when first opened for better performance
- The dropdown stays open when clicking inside the picker
- Pressing Enter or Space on a date closes the picker automatically
- The component handles form validation and can be used with native form submission