Saltar al contenido principal

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​

Abrir Default en Storybook

Small Square​

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

Abrir Small Square en Storybook

Wide Panel​

In a wide box the text steps up a size.

Abrir Wide Panel en Storybook

More Than Fit​

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

Abrir More Than Fit en Storybook

All-Day Events​

Abrir All Day Events en Storybook

12-Hour Clock​

Abrir Twelve Hour Clock en Storybook

Another Time Zone​

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

Abrir Other Time Zone en Storybook

Seven Days​

A full-week agenda view with 7 columns.

Abrir Seven Days en Storybook

With Descriptions​

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

Abrir With Descriptions en Storybook

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.

Abrir Multi Day Event en Storybook

Asymmetric Columns​

Each column is only as long as its events.

Abrir Asymmetric Columns en Storybook

Overnight Event​

Abrir Overnight Event en Storybook

Single Day​

Abrir Single Day en Storybook

Empty​

Abrir Empty en Storybook

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.

Abrir Empty At Content Height en Storybook

See Also​