Saltar al contenido principal

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​

Abrir Default en Storybook

With Events​

Abrir With Events en Storybook

Today With Events​

Abrir Today With Events en Storybook

Monday Start​

Abrir Monday Start en Storybook

February​

Abrir February en Storybook

Fill a Box​

Abrir Fill Box en Storybook

Wide Panel​

Abrir Wide Panel en Storybook

Large Text​

Abrir Large Text en Storybook

See Also​