Forms
Calendar <pm-calendar>
Calendar (WAI-ARIA date grid) with month and year views: click the title to jump to a month, then to a year.
Overview
Single date or range selection, months="2" side by side, min/max, disabled dates, locale-aware week start and names. Keys: arrows move by day/week, PgUp/PgDn month (+Shift year), Home/End week edges, Enter/Space select; in month/year views arrows move, Enter picks, Esc goes back.
Attributes
| Attribute | Type | Default | Description |
|---|---|---|---|
prev-labelprop: prevLabel | string | — | Name of the previous-month button (default "Previous month"), for another language. |
next-labelprop: nextLabel | string | — | Name of the next-month button (default "Next month"). |
value | string | — | "YYYY-MM-DD", or "YYYY-MM-DD/YYYY-MM-DD" with range. |
min | string | — | Lowest allowed value. |
max | string | — | Highest allowed value. |
locale | string | — | BCP 47 locale for names and week start (defaults to the document language). |
range | boolean | false | Select a start and end date instead of one date. |
first-dayprop: firstDay | number | — | Override the locale's first day of the week (0 = Sunday). |
months | number | 1 | Number of months shown side by side (1–3). |
view | 'days' | 'months' | 'years' | days | Current view: day grid, month picker or year picker. |
Also accepts the contextual attributes tone, surface, radius, density, motion, elevation. They are inherited from ancestors' data-* attributes.
Events
| Event | React / Svelte prop | Description |
|---|---|---|
pm-change | onPmChange | Selection changed. detail.value is "YYYY-MM-DD", or "start/end" with range. |
Methods
showDate()