メインコンテンツまでスキップ

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​

StorybookでDefaultを開く

With Events​

StorybookでWith Eventsを開く

Today With Events​

StorybookでToday With Eventsを開く

Monday Start​

StorybookでMonday Startを開く

February​

StorybookでFebruaryを開く

Fill a Box​

StorybookでFill Boxを開く

Wide Panel​

StorybookでWide Panelを開く

Large Text​

StorybookでLarge Textを開く

See Also​