Data
Scheduler <pm-scheduler>
Scheduler: a week or day calendar with events on an hourly grid (bookings, shifts, meetings).
Overview
Overlapping events sit side by side, all-day events get their own row and a line marks the current time. It switches to one day when narrow. Every event is a button named with its title and times; each day has an "Add" button so new events do not depend on clicking the grid. The element shows events; your code stores them.
Attributes
| Attribute | Type | Default | Description |
|---|---|---|---|
events | SchedulerEvent[] | [] | The events to show: { id, title, start, end, tone, allDay }. An array, or JSON in the attribute. |
date | string | — | A day in the period to show, as YYYY-MM-DD (default today). |
view | 'week' | 'day' | week | week (default) or day. Narrow containers always show one day. |
start-hourprop: startHour | number | 7 | First hour on the grid, 0 to 23 (default 7). |
end-hourprop: endHour | number | 20 | Hour the grid ends at, 1 to 24 (default 20). |
week-startprop: weekStart | number | 1 | First day of the week: 0 Sunday, 1 Monday (default). |
label | string | Calendar | Accessible name of the calendar. |
locale | string | — | Language for day and month names (default: the page language). |
height | string | — | Maximum height of the grid before it scrolls: any CSS length (default 32rem). |
hide-weekendsprop: hideWeekends | boolean | false | Leave out Saturday and Sunday in the week view. |
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-event-click | onPmEventClick | An event was activated. |
pm-slot-click | onPmSlotClick | An empty time was clicked, or a day's Add button was used. detail.start and detail.end are local ISO date-times. |
pm-navigate | onPmNavigate | The shown period or view changed. |
CSS parts
| Part | Description |
|---|---|
::part(base) | The whole calendar. |
::part(bar) | The row with Today, previous/next and the view switch. |
::part(day) | One day's time column. |
::part(event) | An event button. |
Methods
step(), today()