Zum Hauptinhalt springen

AgendaCalendar

Every example on this page is live, drawn by the library's Storybook, where you can also change its props and see the result.

A multi-day agenda view showing event cards in vertical columns, under each day's weekday, date and month. Today's date is in a solid circle. Each event is a solid card with its name in bold, its time beneath, the start of its details and the calendar it comes from, so events stay distinct from across a room. Card height is driven by text content rather than event duration, making it ideal for displaying rich event details without the empty gaps of an hourly grid.

The type grows with the columns, names that are too long end in "…", and each column shows as many cards as fit, with a "+N more" line for the rest.

Import​

import { AgendaCalendar } from "~lib/calendar/agenda-calendar";

Props​

NameTypeRequiredDefaultDescription
eventsCalendarEvent[]YesN/AEvents to display
startDateDateYesN/AFirst day of the agenda
daysnumberNo3Number of day columns to show
widthnumber | stringNo300Container width
heightnumber | stringNo300Container height
size"auto" | "sm" | "md" | "lg"No"auto"Text size; "auto" grows it with the width of the columns
timeZonestringNoThe device's zoneTime zone to read days and times in, such as "Europe/London"
timeFormat"24h" | "12h"No"24h"Draw times on a 24-hour or a 12-hour clock

CalendarEvent​

An all-day event's start and end are days, with end the day after the last one, the way calendar feeds write them. Make them from the dates as written, such as new Date("2026-10-05"), so they name the same days in every time zone.

To show a calendar someone has published as a link (the .ics or webcal:// kind), read it with useCalendarFeed, which gives events in this shape.

NameTypeRequiredDescription
namestringYesEvent title
startDateYesStart time
endDateYesEnd time
idstringNoUnique identifier
descriptionstringNoEvent description (ends in "…" after a few lines)
locationstringNoWhere it happens, printed ahead of the description
allDaybooleanNoTakes whole days; shown as "All day"
calendarstringNoThe calendar it comes from, printed on its card
participantsPerson[]NoEvent participants
shadingPatternTypeNoFill pattern (solid, diagonal, dots, crosshatch)

Examples​

Default​

Default in Storybook öffnen

Small Square​

In a small box the text steps down a size, and names too long for their column end in "…".

Small Square in Storybook öffnen

Wide Panel​

In a wide box the text steps up a size.

Wide Panel in Storybook öffnen

More Than Fit​

Each column shows as many cards as fit its height, then a line counting the rest.

More Than Fit in Storybook öffnen

All-Day Events​

All Day Events in Storybook öffnen

12-Hour Clock​

Twelve Hour Clock in Storybook öffnen

Another Time Zone​

Days and times are read in the device's time zone. Pass timeZone to show them somewhere else.

Other Time Zone in Storybook öffnen

Seven Days​

A full-week agenda view with 7 columns.

Seven Days in Storybook öffnen

With Descriptions​

An event's description and participants wrap and end in "…" after a few lines.

With Descriptions in Storybook öffnen

Multi-Day Event​

An event that spans several days shows in each day's column: "From" the time it starts on its first day, "All day" on the days it runs through, and "Until" the time it ends on its last day.

Multi Day Event in Storybook öffnen

Asymmetric Columns​

Each column is only as long as its events.

Asymmetric Columns in Storybook öffnen

Overnight Event​

Overnight Event in Storybook öffnen

Single Day​

Single Day in Storybook öffnen

Empty​

Empty in Storybook öffnen

With height="auto" the agenda is only as tall as its content, and with nothing on its days it keeps one line under the headings for "No events". That lets you wrap it in a Brim without checking for an empty week first.

Empty At Content Height in Storybook öffnen

See Also​