Skip to main content

MultiWeekCalendar

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-week grid view with horizontally spanning event bars. Supports configurable week count, overflow handling, and week-boundary event splitting.

The grid starts on the week holding startDate. The text grows with the columns, names that are too long end in "…", and each week shows as many rows of bars as its height holds, with a "+N more" line under a day that has more.

Import​

import { MultiWeekCalendar } from "~lib/calendar/multi-week-calendar";

Props​

NameTypeRequiredDefaultDescription
eventsCalendarEvent[]YesN/AEvents to display
startDateDateYesN/AA day in the first week; days outside its month are set back
numberOfWeeksnumberNo4Number of week rows to display
maxEventsPerDaynumberNoAs many as fitMost rows of bars a week shows before "+N more"
firstDayOfWeek"sunday" | "monday"No"sunday"Which day starts the week
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 in, such as "Europe/London"

CalendarEvent​

NameTypeRequiredDescription
namestringYesEvent title
startDateYesStart time
endDateYesEnd time
idstringNoUnique identifier
descriptionstringNoEvent description
allDaybooleanNoTakes whole days, listed ahead of timed events that day
participantsPerson[]NoEvent participants
shadingPatternTypeNoFill pattern (solid, diagonal, dots, crosshatch)

Examples​

Default​

Open Default in Storybook

Spanning Events​

Events that span multiple days render as horizontal bars. Events crossing week boundaries are automatically split into separate visual segments.

Open Spanning Events in Storybook

Overflow​

When a day has more events than rows, the last row counts the rest with a "+N more" line. maxEventsPerDay caps the rows below what the height would hold.

Open Overflow in Storybook

Monday Start​

Open Monday Start in Storybook

Six Weeks​

Open Six Weeks in Storybook

With Patterns​

Open With Patterns in Storybook

Dense Week​

Open Dense Week in Storybook

Small Square​

Open Small Square in Storybook

Wide Panel​

Open Wide Panel in Storybook

More Than Fit​

In a short box each week holds fewer rows of bars, and days count what they cannot show.

Open More Than Fit in Storybook

See Also​