Loading...
Installation
Install the following dependencies:
Copy and paste the following code into your project.
Loading...
Update the import paths to match your project setup.
Composition
<app-date-picker> ├── [appDatePickerLabel] (optional) ├── <app-date-picker-input> (input-style trigger) ├── [appDatePickerControl] (button-style trigger) │ └── [appDatePickerTrigger] | <app-date-picker-trigger> │ └── [appDatePickerValueText] └── <app-date-picker-content> ├── <app-date-picker-day-view> | <app-date-picker-dual-month-day-view> ├── <app-date-picker-month-view> └── <app-date-picker-year-view>
Examples
Default
Loading...
Input
Loading...
Range
Loading...
Date of Birth
Loading...
API Reference
<app-date-picker>
Inputs
| Input | Type | Default | Description |
|---|---|---|---|
id | string | undefined | generated | Unique identifier used to connect the date-picker parts. |
ids | Partial<DatePickerElementIds> | undefined | — | Overrides generated identifiers for individual parts. |
value | DateValue[] | undefined | — | Selected dates when controlled. Supports Angular two-way binding. |
defaultValue | DateValue[] | undefined | — | Initially selected dates when uncontrolled. |
focusedValue | DateValue | undefined | — | Focused date when controlled. Supports Angular two-way binding. |
defaultFocusedValue | DateValue | undefined | — | Initially focused date. |
view | "day" | "month" | "year" | undefined | — | Current view when controlled. Supports Angular two-way binding. |
defaultView | "day" | "month" | "year" | undefined | — | Initial calendar view. |
open | boolean | undefined | — | Popup state when controlled. Supports Angular two-way binding. |
defaultOpen | boolean | false | Initial popup state when uncontrolled. |
inline | boolean | false | Renders the calendar inline instead of in popup content. |
disabled | boolean | false | Disables interaction with the date picker. |
readOnly | boolean | false | Prevents changes while preserving focus and navigation. |
required | boolean | false | Marks the associated form control as required. |
invalid | boolean | false | Marks the associated form control as invalid. |
outsideDaySelectable | boolean | false | Allows days outside the visible month to be selected. |
closeOnSelect | boolean | true | Closes the popup after a selection is completed. |
openOnClick | boolean | false | Opens the popup when its input is clicked. |
fixedWeeks | boolean | false | Always renders six calendar weeks. |
showWeekNumbers | boolean | false | Includes week numbers in the calendar grid. |
min | DateValue | undefined | — | Earliest selectable date. |
max | DateValue | undefined | — | Latest selectable date. |
minView | "day" | "month" | "year" | undefined | — | Most detailed view available. |
maxView | "day" | "month" | "year" | undefined | — | Broadest view available. |
numOfMonths | number | undefined | — | Number of months represented by the calendar state. |
startOfWeek | number | undefined | — | First weekday, from 0 for Sunday through 6 for Saturday. |
selectionMode | "single" | "multiple" | "range" | undefined | — | Determines how dates are selected. |
maxSelectedDates | number | undefined | — | Limits selections in multiple mode. |
locale | string | undefined | — | Locale used to format and parse dates. |
timeZone | string | undefined | — | Time zone used when converting and formatting values. |
translations | DatePickerIntlTranslations | undefined | — | Accessible labels for the date-picker controls. |
name | string | undefined | — | Name used when submitting the value with a form. |
placeholder | string | undefined | — | Placeholder used by the default formatter. |
format | ((date: DateValue, details: DatePickerLocaleDetails) => string) | undefined | — | Formats values for inputs and value text. |
parse | ((value: string, details: DatePickerLocaleDetails) => DateValue | undefined) | undefined | — | Parses typed input into a date value. |
createCalendar | ((identifier: CalendarIdentifier) => Calendar) | undefined | — | Creates the calendar system used by the picker. |
isDateUnavailable | ((date: DateValue, locale: string) => boolean) | undefined | — | Marks dates that cannot be selected. |
positioning | DatePickerPositioningOptions | undefined | — | Configures popup placement and collision handling. |
Use [(value)]="value", [(focusedValue)]="focusedValue", [(view)]="view", or
[(open)]="open" for two-way binding. The matching *Change output emits the updated model
value. The root also implements Angular's ControlValueAccessor for forms integration.
Outputs
| Output | Type | Description |
|---|---|---|
valueChange | DateValue[] | undefined | Emits the updated selected dates. |
focusedValueChange | DateValue | undefined | Emits the updated focused date. |
viewChange | "day" | "month" | "year" | undefined | Emits the updated calendar view. |
openChange | boolean | undefined | Emits the updated popup state. |
valueDetailsChange | DatePickerValueChangeDetails | Emits detailed selection-change information. |
focusChange | DatePickerFocusChangeDetails | Emits when the focused date changes. |
viewDetailsChange | DatePickerViewChangeDetails | Emits detailed view-change information. |
visibleRangeChange | DatePickerVisibleRangeChangeDetails | Emits when the visible date range changes. |
openDetailsChange | DatePickerOpenChangeDetails | Emits detailed open-state change information. |
<app-date-picker-input>
Inputs
| Input | Type | Default | Description |
|---|---|---|---|
id | string | undefined | — | ID applied to the generated native input. |
placeholder | string | "" | Placeholder displayed by the input. |
disabled | boolean | false | Disables the input and its generated controls. |
showTrigger | boolean | true | Shows the generated calendar trigger. |
showClear | boolean | false | Shows a clear action when the input has a value. |
size | "default" | "lg" | "xl" | "default" | Sets the input-group size. |
Configurable Directives
| Selector | Input | Type | Description |
|---|---|---|---|
[appDatePickerView] | view | "day" | "month" | "year" | Identifies the calendar view rendered inside it. |
[appDatePickerTableCell] | value | DateValue | number | Date, month, or year represented by the cell. |
[appDatePickerTableCell] | visibleRange | DatePickerVisibleRange | undefined | Associates the cell with an offset month range. |
[appDatePickerPresetTrigger] | value | DatePickerPresetTriggerValue | Date or range selected by the preset trigger. |
Components, Directives, and Context
| Export | Angular API |
|---|---|
DatePickerLabelDirective | [appDatePickerLabel] label directive. |
DatePickerControlDirective | [appDatePickerControl] groups a trigger or input with the picker. |
DatePickerInputComponent | <app-date-picker-input> input-group component. |
DatePickerInputDirective | [appDatePickerInput] applies date-input behavior to a native input. |
DatePickerTriggerComponent | <app-date-picker-trigger> generated trigger component. |
DatePickerTriggerDirective | [appDatePickerTrigger] applies trigger behavior to a custom button. |
DatePickerClearTriggerComponent | <app-date-picker-clear> generated clear button. |
DatePickerContentComponent | <app-date-picker-content> portalled popup content. |
DatePickerDayViewComponent | <app-date-picker-day-view> single-month day grid. |
DatePickerDualMonthDayViewComponent | <app-date-picker-dual-month-day-view> two-month day grid with shared navigation. |
DatePickerMonthViewComponent | <app-date-picker-month-view> month-selection grid. |
DatePickerYearViewComponent | <app-date-picker-year-view> year-selection grid. |
DatePickerValueTextDirective | [appDatePickerValueText] displays the selected value inside a custom trigger. |
DatePickerRangeTextDirective | [appDatePickerRangeText] displays the current view range. |
DatePickerContext | Structural directive [date-picker-context] exposing the picker API to a template. |
DatePickerRootProvider | Provides an externally created date-picker machine to a component tree. |
DatePickerImports | Readonly collection containing all date-picker components and directives. |
useDatePicker | Creates a date-picker machine within an Angular injection context. |
injectDatePickerContext | Injects the nearest date-picker machine. |
Utilities and Supporting Types
| Export | API |
|---|---|
CalendarDate | Represents a calendar date without a time or time zone. |
DateValue | Date value type accepted by the picker. |
getLocalTimeZone | Returns the current local IANA time-zone identifier. |
parseDate | Parses an ISO 8601 date string into a CalendarDate. |
Angular
React
Solid
Svelte
Vue