Search documentation

Search the documentation and open a page.

A calendar component for selecting dates, ranges, and multiple dates.

Loading...

Installation

pnpm dlx shadcn@latest add @wirekyt/calendar

Composition

<app-calendar> ├── <app-calendar-day-view> │ └── <app-calendar-select-header> ├── <app-calendar-dual-month-day-view> ├── <app-calendar-month-view> │ └── <app-calendar-select-header> └── <app-calendar-year-view> └── <app-calendar-select-header>

Examples

Default

Loading...

Month Year Selector

Loading...

Presets

Loading...

Range Vertical

Loading...

Range With Presets

Loading...

Range

Loading...

API Reference

<app-calendar>

Inputs

InputTypeDefaultDescription
idstring | undefinedgeneratedUnique identifier used to connect the calendar parts.
idsPartial<DatePickerElementIds> | undefined—Overrides generated identifiers for individual parts.
valueDateValue[] | undefined—Selected dates when controlled. Supports Angular two-way binding.
defaultValueDateValue[] | undefined—Initially selected dates when uncontrolled.
focusedValueDateValue | undefined—Focused date when controlled. Supports Angular two-way binding.
defaultFocusedValueDateValue | undefined—Initially focused date.
view"day" | "month" | "year" | undefined—Current calendar view when controlled. Supports Angular two-way binding.
defaultView"day" | "month" | "year" | undefined—Initial calendar view.
openboolean | undefined—Whether the calendar is open when controlled. Supports two-way binding.
defaultOpenbooleanfalseInitial open state when uncontrolled.
inlinebooleanfalseRenders the calendar inline instead of as popup content.
disabledbooleanfalseDisables interaction with the calendar.
readOnlybooleanfalsePrevents changes while preserving focus and navigation.
requiredbooleanfalseMarks the associated form control as required.
invalidbooleanfalseMarks the associated form control as invalid.
outsideDaySelectablebooleanfalseAllows days outside the visible month to be selected.
closeOnSelectbooleantrueCloses popup content after a selection is completed.
openOnClickbooleanfalseOpens popup content when its input is clicked.
fixedWeeksbooleanfalseAlways renders six calendar weeks.
showWeekNumbersbooleanfalseIncludes week numbers in the calendar grid.
minDateValue | undefined—Earliest selectable date.
maxDateValue | undefined—Latest selectable date.
minView"day" | "month" | "year" | undefined—Most detailed view available.
maxView"day" | "month" | "year" | undefined—Broadest view available.
numOfMonthsnumber | undefined—Number of months represented by the calendar state.
startOfWeeknumber | undefined—First weekday, from 0 for Sunday through 6 for Saturday.
selectionMode"single" | "multiple" | "range" | undefined—Determines how dates are selected.
maxSelectedDatesnumber | undefined—Limits selections in multiple mode.
localestring | undefined—Locale used to format and parse dates.
timeZonestring | undefined—Time zone used when converting and formatting values.
translationsDatePickerIntlTranslations | undefined—Accessible labels for the calendar controls.
namestring | undefined—Name used when submitting the value with a form.
placeholderstring | 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 component.
isDateUnavailable((date: DateValue, locale: string) => boolean) | undefined—Marks dates that cannot be selected.
positioningDatePickerPositioningOptions | undefined—Configures popup placement and collision handling.

Outputs

OutputTypeDescription
valueChangeDateValue[] | undefinedEmits the updated selected dates.
focusedValueChangeDateValue | undefinedEmits the updated focused date.
viewChange"day" | "month" | "year" | undefinedEmits the updated calendar view.
openChangeboolean | undefinedEmits the updated open state.
valueDetailsChangeDatePickerValueChangeDetailsEmits detailed selection-change information.
focusChangeDatePickerFocusChangeDetailsEmits when the focused date changes.
viewDetailsChangeDatePickerViewChangeDetailsEmits detailed view-change information.
visibleRangeChangeDatePickerVisibleRangeChangeDetailsEmits when the visible date range changes.
openDetailsChangeDatePickerOpenChangeDetailsEmits detailed open-state change information.

Components, Directives, and Context

ExportAngular API
CalendarSelectHeaderMonth/year selector and previous/next controls used by single-month views.
CalendarDayViewRenders the single-month day grid.
CalendarDualMonthDayViewRenders two adjacent month grids with shared navigation.
CalendarMonthViewRenders the month-selection grid.
CalendarYearViewRenders the year-selection grid.
CalendarPresetTriggerAlias of the [date-picker-preset-trigger] directive for preset selections.
DatePickerContextStructural directive [date-picker-context] exposed through CalendarImports.
CalendarImportsReadonly collection containing all calendar components and context helpers.

Utilities and Supporting Types

ExportAPI
CalendarDateRepresents a calendar date without a time or time zone.
getLocalTimeZoneReturns the current local IANA time-zone identifier.
parseDateParses an ISO 8601 date string into a CalendarDate.
DateValueDate value accepted by the calendar component.