Component Variants
app-datepicker provides three main component variants, each optimized for different use cases:date-picker
Standalone calendar picker component
date-picker-dialog
Calendar picker inside a modal dialog
date-picker-input
Text field with integrated calendar picker
Installation
Importing Components
Basic Date Picker
Theapp-date-picker component renders a standalone calendar interface.
Date Picker Dialog
Theapp-date-picker-dialog wraps the calendar in a Material Design dialog with action buttons.
The dialog component requires Material Web Components (
@material/mwc-dialog and @material/mwc-button) as peer dependencies.Date Picker Input
Theapp-date-picker-input provides a text field that opens a calendar picker when clicked.
Setting Values
All components share the same value interface:- String Value
- Date Object
- Timestamp
Common Properties
These properties are available on all three components:Date Range
Start View
View the full startView source code
View the full startView source code
From
src/constants.ts:22:Week Numbers
Event Handling
Date Updated Event
Fired when the user selects a date:View event type definition
View event type definition
From
src/typings.ts:18-23:First Updated Event
Fired once when the component first renders:Dialog-Specific Events
Forapp-date-picker-dialog only:
Input-Specific Events
Forapp-date-picker-input only:
Programmatic Control
Dialog Methods
Input Methods
Complete Example
Here’s a complete example using Lit:Next Steps
Localization
Learn how to localize the date picker for different languages and regions
Styling
Customize the appearance with CSS custom properties
Advanced Features
Explore disabled dates, week numbers, and custom formatters
API Reference
View complete API documentation