HomeGetting StartedColor SystemTypographySpacingIconographyLayoutInstallationUsageAngularBlazorReactSvelteVueThemingTypographyCustomizationCSS-Only ComponentsFormsIconsIllustrationsAccessibilityGlobal ConfigurationTailwind CSSSass LibraryForge MCP ServerDropdown OptionsFocus Indicator ClippingAll componentsButtonButton AreaChipFloating Action ButtonIcon ButtonSplit ButtonAutocompleteButton ToggleCalendarCheckboxChip FieldColor PickerDate PickerDate Range PickerFile PickerLabelRadioSelectSliderSwitchText FieldTime PickerApp BarApp LauncherDrawerMenuPaginatorSkip LinkStepperTabsView SwitcherAccordionApp LayoutCardDividerExpansion PanelScaffoldSplit ViewStackStructured CardToolbarBadgeBannerBusy IndicatorCircular ProgressDialogInline MessageLinear ProgressPage StateSkeletonToastTooltipAvatarIconKeyLabel ValueListMeterSecretTableTimelineTimestampTreeKeyboard ShortcutPopoverIntroductionColorTypographySpacingShapeBorderElevationLayeringAnimationUsageIcon LibraryBlocksRoadmapChangelogBlog

Calendar

A flexible calendar component for date selection with support for single dates, ranges, multiple selections, and extensive customization options.

Overview

The calendar component displays dates in a monthly grid format. It allows users to visually navigate and select dates by browsing through months and years, providing an intuitive interface for date-related tasks and temporal data visualization.

Usage

forge-calendar selects one or more dates through mode (single, multiple, or range), plus min/max/disabledDates/disabledDaysOfWeek constraints, events, and view. Use it when the task is calendar-driven and the surrounding days give useful context, like picking a day off. Reach for a date picker instead when a user is typing in a familiar date and screen space is limited, or a date range picker instead for a bounded start/end range in that same compact form.

Rules

Do
Use a calendar when the task is primarily calendar-driven, like a time-off request.Use a calendar when a user needs to select multiple dates that aren't necessarily chronological.Show events or disabled dates directly on the grid so context is visible while choosing.
Don't
Don't use a calendar for familiar dates like birthdays or card expirations — use a date picker instead.Don't use a calendar when the date isn't central to the task at hand — use a date picker instead.Don't use a calendar where screen space is limited — use a date picker instead.

Selection mode

Set mode to single (the default), multiple for several non-chronological dates, or range for a bounded start and end date.

Single

The default mode — one date at a time.

Constraints

Set min, max, and disabledDaysOfWeek to bound selectable dates and exclude specific days, such as weekends.

A calendar bounded to a range, with weekends disabled.

Views

Set view to open the calendar directly into its year view instead of the default day grid.

Opening directly into the year view.

Header controls

Set showToday and showClear to add today and clear shortcuts to the calendar’s header.

Today and clear shortcuts in the calendar's header.

Readonly

Set readonly to show the current selection without allowing the user to change it.

A readonly calendar shows the selection without allowing changes.

A flexible calendar component for date selection with support for single dates, ranges, multiple selections, and extensive customization options.

import "@tylertech/forge/calendar";
Properties
PropertyAttributeTypeDefaultDescription
activeDate—Date—The currently active date in the calendar.
allowSingleDateRangeallow-single-date-rangebooleantrueWhether to allow a single date range to be selected.
clearButtonclear-buttonbooleanfalseWhether to show a button to clear the selected date(s).
clearCallback—() => void | undefined—Callback function to call when the clear button is clicked.
constrainToEnabledconstrain-to-enabledbooleantrueWhether to constrain the selected date(s) to the enabled dates.
dateBuilder—CalendarDateBuilder | undefined—Function to build the date content.
dateSelectCallback—CalendarDateSelectCallback | undefined—Callback function to call when a date is selected.
dayBuilder—CalendarDayBuilder | undefined—Function to build the day content.
disabledDateBuilder—(date: Date) => boolean | undefined—Function to determine if a date is disabled.
disabledDates—Date | Date[] | null | undefined[]Dates that are disabled from being selected.
disabledDaysOfWeek—DayOfWeek | DayOfWeek[] | null | undefined[]Days of the week that are disabled from being selected.
eventBuilder—CalendarEventBuilder | undefined—Function to build the event content.
events—ICalendarEvent[] | null | undefined[]Events to display on the calendar.
firstDayOfWeekfirst-day-of-weekDayOfWeek—The first day of the week.
fixedHeightfixed-heightbooleanfalseWhether to fix the height of the calendar.
listYearslist-yearsbooleantrueWhether to list the years in the year view.
localelocalestring—The locale to use for formatting dates.
maxmaxDate | string | null—The maximum date that can be selected.
menuAnimationmenu-animationCalendarMenuAnimationType"scale"The animation to use for the menu.
minminDate | string | null—The minimum date that can be selected.
modemodeCalendarMode"single"The mode of the calendar.
monthmonthnumber<current month>The month to display.
preventFocusprevent-focusbooleanfalseWhether to prevent the calendar from taking focus.
readonlyreadonlybooleanfalseWhether the calendar is readonly.
selectionFollowsMonthselection-follows-monthbooleanfalseWhether the selection follows the month.
showHeadershow-headerbooleantrueWhether to show the header.
showOtherMonthsshow-other-monthsbooleanfalseWhether to show days from other months.
showTodayshow-todaybooleantrueWhether to show the today button.
todayButtontoday-buttonbooleanfakseWhether to show a button to select today.
todayCallback—() => void | undefined—Callback function to call when the today button is clicked.
tooltipBuilder—CalendarTooltipBuilder | undefined—Function to build the tooltip content.
value—Date | Date[] | DateRange | null | undefined[]The selected date(s).
viewviewCalendarView"date"The view of the calendar.
weekendDays—DayOfWeek[] | null | undefined—The days of the week that are considered weekends.
yearyearnumber<current year>The year to display.
yearRangeyear-rangestring"-50:+50"The range of years to display.
Events
NameTypeDescription
forge-calendar-date-selectCustomEvent<ICalendarDateSelectEventData>Event fired when a date is selected.
forge-calendar-focus-changeCustomEvent<ICalendarFocusChangeEventData>Event fired when the focus changes.
forge-calendar-month-changeCustomEvent<ICalendarMonthChangeEventData>Event fired when the month changes.
forge-calendar-view-changeCustomEvent<CalendarView>Event fired when the view changes.
Slots
NameDescription
today-button-textText to display in the today button.
clear-button-textText to display in the clear button.
next-month-button-textText to display in the next month button's tooltip.
previous-month-button-textText to display in the previous month button's tooltip.
next-year-button-textText to display in the next year button's tooltip.
previous-year-button-textText to display in the previous year button's tooltip.
next-years-button-textText to display in the next years button's tooltip.
previous-years-button-textText to display in the previous years button's tooltip.
Methods
NameReturnsDescription
clear()voidClears the selected date(s).
deselectDate(date)voidDeselects a date.
goToDate(date, setFocus)voidNavigates to a specific date.
handleKey(evt)voidHandles a keyboard event.
layout()voidLays out the calendar.
selectDate(date)voidSelects a date.
setActiveDate(date, setFocus)booleanSets the active date.
today()voidSets the calendar to today.
toggleDate(date, force)voidToggles a date selection.

Keyboard interaction

Days must be navigable by keyboard.

Screen reader behavior

Each day should be announced individually, including whether it’s currently selected.

Loading Forge chat…