Skip to main content

MonthlyCalendar

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 monthly grid calendar. Highlights today with a filled circle and shows event dots beneath days with events.

The dates grow with the cells. Given a height, the weeks share it out; without one, each week is as tall as its dates need.

Import​

import { MonthlyCalendar } from "~lib/calendar/monthly-calendar";

Props​

NameTypeRequiredDefaultDescription
yearnumberYesN/AYear to display
monthnumberYesN/AMonth (1-12)
eventsCalendarEvent[]No[]Events to display as dots beneath day numbers
todayDateNoThe day the frame showsOverride for today (useful for stories/tests)
firstDayOfWeek"sunday" | "monday"No"sunday"Week start day
widthnumber | stringNo280Container width
heightnumber | stringNoAs tall as the weeksContainer height, shared out among the weeks
size"auto" | "sm" | "md" | "lg" | numberNo"auto"Text size; "auto" grows it with the cells. A number sets the width, as before
timeZonestringNoThe device's zoneTime zone to read days in, such as "Europe/London"

Examples​

Default​

Open Default in Storybook

With Events​

Open With Events in Storybook

Today With Events​

Open Today With Events in Storybook

Monday Start​

Open Monday Start in Storybook

February​

Open February in Storybook

Fill a Box​

Open Fill Box in Storybook

Wide Panel​

Open Wide Panel in Storybook

Large Text​

Open Large Text in Storybook

See Also​