Skip to main content

Overview

The app-month-calendar component is a low-level calendar grid that displays a single month view. It’s used internally by app-date-picker but can also be used standalone for custom implementations.

Installation

Import

Or import from specific path:

Usage

This is a low-level component. Most use cases should use app-date-picker instead.

Properties

MonthCalendarData
Calendar data object containing all necessary information to render the month view.
Promise<HTMLTableCellElement | null>
Async query for the currently selected calendar day element.

Events

date-updated

Fires when a date is selected (clicked or via keyboard).

CSS Shadow Parts

Available Parts

  • calendar - Main calendar container
  • table - Calendar table element
  • caption - Month/year caption (if shown)
  • weekdays - Weekday headers row
  • weekday - Individual weekday header
  • weekday-value - Weekday text content
  • week-number - Week number cells
  • calendar-day - Calendar day cells
  • today - Today’s date cell

Keyboard Navigation

  • Arrow Up - Previous week (same day)
  • Arrow Down - Next week (same day)
  • Arrow Left - Previous day
  • Arrow Right - Next day
  • Home - First day of current week
  • End - Last day of current week
  • Page Up - Previous month (same day)
  • Page Down - Next month (same day)
  • Alt + Page Up - Previous year (same day)
  • Alt + Page Down - Next year (same day)
  • Enter / Space - Select focused date

Methods

method
Protected method for rendering individual calendar day cells. Can be overridden for customization.

Example: Custom Calendar

TypeScript

Behavior Notes

  • The component uses delegatesFocus: true for better keyboard accessibility
  • Only updates when data and data.formatters are both set
  • Automatically focuses the selected date when navigating with keyboard
  • Prevents event propagation to work properly within dialogs
  • Handles disabled dates and days by preventing selection
  • Supports right-to-left (RTL) layouts automatically