Create

General

Event Calendar

New
Copy page View as Markdown Open in ChatGPT Open in Claude

A calendar of events by month, week, day or agenda, with drag to move and resize, drawn ranges, repeating events, resource columns and a resource timeline.

Usage#

app.component.ts
import { WdsEventCalendarComponent } from '@wds/angular/event-calendar';

The calendar shows events and changes their dates; creating and editing the details (title, guests) is up to you: listen to wds-slot-select and wds-event-click and open your own dialog. Load the events of the visible period from wds-range-change. With resources, the timeline-day, timeline-week and timeline-month views show a row per resource with time running across. Put your own content in an event or a resource heading with an element in the event-<id> or resource-<id> slot. Ready-made screens (a shift roster, a clinic schedule, a booking board) are in Event Calendar blocks.

Examples#

Default#

events is a property (in HTML set it from a script). A date (2026-10-05) is an all-day event with an inclusive end; a date-time is a timed event with an exclusive end. The view switcher shows views; drag an event to move it, drag its edge to resize it. The calendar updates events itself and fires wds-event-change with the new list. recurrence repeats an event (an RRULE such as FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR): moving one occurrence moves the series.

Last change: none

Creating and editing events#

The calendar does not edit event details itself. With drag-create, drawing a range on empty time (or clicking it) fires wds-slot-select, and a click on an event fires wds-event-click; here both open a Dialog built from Field, Input and Select. Save adds or replaces the event in events.

TitleColorBlueGreenOrangePurpleRed
CancelSave

Month#

view="month" shows the weeks of the month. Events that do not fit in max-events rows are behind a “+N more” button that opens a Popover with the whole day. week-numbers adds ISO week numbers; hide-weekends hides Saturdays and Sundays.

Resources#

resources (such as rooms or people) splits the day of the resource view into columns; resource-views splits other time-grid views too (here day and days). An event goes to the column of its resourceId and can be dragged to another one. day-start and day-end limit the hours, business-hours shades the rest, and days sets the length of the days view. work-week shows Monday to Friday.

Validation and context menu#

canDropEvent runs before a move or resize is applied: returning false rejects it (here: overlapping events and weekends), and a screen reader hears that the change is not allowed. An event with readOnly cannot be moved. eventActions adds a menu on right click, Shift+F10 or the Menu key; the chosen item comes in wds-event-action. snap sets the step of moves in minutes.

Drag an event onto another one or a weekend, or right click it.

API References#

wds-event-calendar#

An event calendar: a month of weeks, a week, a day or a number of days with hours, and an agenda list. Events can be moved and resized with the pointer or the keyboard, drawn on empty time (drag-create), repeated with a rule, and split into columns per resource (such as rooms). The calendar only shows events: it fires wds-event-click and wds-slot-select, so open your own dialog to create or edit one.

Attributes

AttributeTypeDefaultDescription
resource-views.resourceViewsWdsEventCalendarView[]Time-grid views split into a column per resource (each day × each resource). In HTML a space-separated list. Default: only the resource view (one day). Add day, days, week or work-week to split them too.
viewWdsEventCalendarView'week'The view shown.
viewsWdsEventCalendarView[]Views in the view switcher, in this order. In HTML a space-separated list. Empty: no switcher.
datestring''A date in the period shown (ISO). Empty: today.
daysnumber3Number of days of the days view.
agenda-days.agendaDaysnumber30Number of days of the agenda view, from date.
day-start.dayStartnumber0First hour of the time grid (0–23).
day-end.dayEndnumber24Last hour of the time grid (1–24, exclusive).
business-hours.businessHoursstring''Working hours, such as 09:00-17:00: the rest of the time grid is shaded.
scroll-time.scrollTimestring'08:00'Time the time grid scrolls to when it opens (such as 08:00); for today the current time wins.
hour-height.hourHeightnumber48Height of an hour in the time grid, in px.
snapnumber15Step of moves, resizes and drawn ranges in the time grid, in minutes.
max-events.maxEventsnumber3Event rows in a month day; more events show a “+N more” button.
lane-height.laneHeightnumber24Height of an event row in the month, the all-day row and the timeline, in px (such as for taller event-<id> content).
event-variant.eventVariant'default' | 'soft''default'Look of the events: default (a color bar at the start) or soft (a tinted card with a tinted border all around).
hide-weekends.hideWeekendsbooleanfalseHides Saturdays and Sundays in the month, week, days, timeline-week and timeline-month views (the work-week views always hide them).
week-numbers.weekNumbersbooleanfalseShows ISO week numbers in the month view.
readonlybooleanfalseEvents cannot be moved, resized or deleted.
drag-create.dragCreatebooleanfalseDrawing a range on empty time (or clicking it) fires wds-slot-select, such as to add an event there.
time-zone.timeZonestring''IANA time zone the calendar shows times in (such as Europe/Warsaw). Default: the browser's.
localestring''Language of dates (such as en-US). Defaults to the nearest lang attribute.
first-day.firstDaynumber | undefinedFirst day of the week: 0 = Sunday, 1 = Monday. Defaults to the language.
hide-nav.hideNavbooleanfalseHides the navigation bar (navigate with next(), prev(), today() and goTo()).
fillbooleanfalseFills the height of the parent (such as a grid row next to a sidebar): the time grid, the timeline and the month grow with it. --wds-event-calendar-height is then the minimum height of the scrolling grid.
loadingbooleanfalseShows a spinner in the navigation bar and sets aria-busy (such as while events load).
empty-text.emptyTextstring'No events.'Text of an agenda without events.
labelstring'Calendar'Accessible name of the calendar.

Properties

PropertyDescription
eventsWdsCalendarEvent[]Events (WdsCalendarEvent[]). The calendar updates this array itself after a move, resize or delete.
resourcesWdsCalendarResource[]Resources (WdsCalendarResource[]), such as rooms or people: columns of the time grid in resource-views and rows of the timeline; events go to the column or row of their resourceId.
eventActionsWdsEventCalendarAction[]Items of the event context menu (right click, Shift+F10 or the Menu key), see wds-event-action.
renderEvent(event: WdsCalendarEvent) => string | Node | undefinedCustom event content (text or a DOM node, styled inline or a wds-* element: it renders in shadow DOM) instead of the title.
canDropEvent(change: Omit<WdsEventCalendarEventChangeDetail, 'events'>) => boolean | undefinedValidates a move or resize before it is applied: return false to reject it.
canSelectSlot(slot: WdsEventCalendarSlotSelectDetail) => boolean | undefinedValidates a range drawn with drag-create: return false to reject it (the preview turns red).

Events

EventDescription
wds-range-changeCustomEvent<WdsEventCalendarRangeChangeDetail>The view or the period changed.
wds-event-changeCustomEvent<WdsEventCalendarEventChangeDetail>An event was moved or resized (after canDropEvent accepted it).
wds-event-removeCustomEvent<WdsEventCalendarEventRemoveDetail>Events were deleted with Delete or Backspace.
wds-event-clickCustomEvent<WdsEventCalendarEventClickDetail>An event was clicked (or Enter on it).
wds-slot-selectCustomEvent<WdsEventCalendarSlotSelectDetail>An empty range was drawn or clicked (drag-create), or Enter was pressed on a day or time.
wds-event-actionCustomEvent<WdsEventCalendarEventActionDetail>An item of the event context menu (eventActions) was chosen.

Methods

MethodDescription
next()Shows the next period.
prev()Shows the previous period.
today()Shows the period with today.
goTo(date: string)Shows the period with the given date (ISO).

Slots

SlotDescription
toolbarExtra items at the end of the navigation bar (such as an “Add event” button).
emptyContent of an agenda without events (instead of empty-text).
actionsItems after the view switcher (such as filters or a “New booking” button).
event-<id>Content of the event with this id instead of its title (page styles apply). An event shown more than once (a repeated or long event) gets it only in the first place; the others show the title.
resource-<id>Content of the column or timeline row heading of the resource with this id instead of its title.

CSS parts (::part)

PartDescription
navThe navigation bar.
titleThe period title in the navigation bar.
viewsThe view switcher.
gridThe month or time grid (role="grid").
agendaThe agenda list.
bodyThe frame around the grid or the agenda (border and radius), such as to remove it inside a card.
background-eventA background event (display: 'background').

CSS custom properties

PropertyDescription
--wds-event-calendar-heightHeight of the scrolling time grid (default 40rem); with fill its minimum height.
--wds-event-calendar-hour-heightHeight of an hour in the time grid (default 48px; hour-height sets it).
--wds-event-calendar-eventDefault event color (default --wds-chart-2).
--wds-event-calendar-nowColor of the current time line (default --wds-destructive).
--wds-event-calendar-resource-widthWidth of the resource column of the timeline (default 12rem).
--wds-event-calendar-slot-widthSmallest width of a timeline column: an hour in timeline-day, a day in timeline-week (default 4rem / 8rem / 3rem in timeline-month).

Accessibility#

Screen reader#

The calendar is a region named by label. The month and the time grid are a grid named by the period: the month has a columnheader per weekday and a gridcell per day (named by its date and the number of events); the time grid has a gridcell per day (or day and resource) named by the date and the time of the keyboard cursor. The timeline has a row per resource with a rowheader and one gridcell named by the resource and the cursor time; group headings are rowheaders too.

Background events (display: 'background') are decoration only (aria-hidden): describe holds in your own text if they matter.

An event is a button named by its title, date and time, description, “repeats” for an occurrence and its resource, such as “Design review, Wednesday, October 7, 11:00 AM – 12:30 PM, Room A”. Movable events are described by the keys that move them.

Moves, resizes, deletions and rejected changes are announced in a live region (such as “Lunch with Ana: Wednesday, October 7, 12:15 – 1:15 PM”). The period title is a live region too.

Built-in texts are in English (such as Today, All day, +2 more, Previous period).

Keyboard support#

KeyFunction
TabMoves between the navigation bar, the grid (one stop: the keyboard cursor) and the events (one stop: the last focused event).
ArrowLeftArrowRightArrowUpArrowDownIn the month: moves the cursor by a day or a week. In the time grid: by a column or by snap minutes. In the timeline: by snap minutes (timeline-day) or a day, and to the previous or next resource. On an event: to the previous or next event.
HomeEndIn the month: first or last day of the week. In the time grid: first or last hour. In the timeline: start or end of the day or period. On an event: first or last event.
PageUpPageDownIn the month: previous or next month. In the time grid: an hour up or down.
EnterSpaceOn a day or time with drag-create: fires wds-slot-select for that day or hour. On an event: fires wds-event-click.
Shift + ArrowLeftShift + ArrowRightOn an event: moves it a day earlier or later.
Shift + ArrowUpShift + ArrowDownOn an event: moves it snap minutes earlier or later in the time grid, a week in the month, or to the previous or next resource in the timeline.
Alt + ArrowUpAlt + ArrowDownOn an event in the time grid: makes it snap minutes shorter or longer.
Alt + ArrowLeftAlt + ArrowRightOn an event in the month or the all-day row: makes it a day shorter or longer. In the timeline: snap minutes (timeline-day) or a day.
DeleteBackspaceOn an event: deletes it (wds-event-remove).
Shift + F10On an event: opens the eventActions menu (also the Menu key).
EscapeWhile dragging: cancels the move.
Footer