---
agent:
  instructions: "Search goop.so for Goop's components, templates, design skill, docs, pricing and terms. Ask in keywords or a plain question, such as \"date picker props\" or \"is the design skill free\"; the answer is the matching page sections in Markdown, each with its address."
  endpoint: "https://goop.so/.well-known/search?q={query}"
  method: "GET"
  documentation: "https://developers.cloudflare.com/ai-search/how-to/search-for-agents/"
---

# Month calendar

A month of events, a row a week and a cell a day, each day listing its events as chips in their colours, for React and Tailwind CSS. Part of Goop Pro.

Pro. Its export: `MonthCalendar`.

## When to use

- A month of events, a row a week and a cell a day, each day listing its events as chips in their colours.
- Use it for a month of dated events, never a grid of day boxes by hand. Give it a box with a height (its weeks share it) and a `WeekCalendarToolbar` over it: the month's name, Today, and previous and next calling your `month`.

## Installation

Paste the prompt below into your coding agent. It reads Goop's install steps, installs the part and its tokens once, then reuses this same Month calendar on every screen instead of drawing a new one: the same height, the same focus ring, the same spacing. As a Pro part, its command comes from Goop's server once you sign in, with a one-time link that lasts ten minutes.

```sh
npx shadcn@4.23.1 add https://registry.goop.so/g/<link>/meadow-month-calendar.json --yes
```

```text
Add the Goop Month calendar to this project. The install steps are at https://goop.so/docs/install.md
```

## Usage

```tsx
import { useState } from 'react';
import { Button } from '@/components/ui/goop/button';
import { IconButton, IconButtonIcon } from '@/components/ui/goop/icon-button';
import { MonthCalendar, type MonthCalendarEvent } from '@/components/ui/goop/month-calendar';
import { WeekCalendarToolbar } from '@/components/ui/goop/week-calendar';

const step = (month: string, by: number) => {
  const index = Number(month.slice(0, 4)) * 12 + Number(month.slice(5, 7)) - 1 + by;
  return `${Math.floor(index / 12)}-${String((index % 12) + 1).padStart(2, '0')}`;
};
const EVENTS: MonthCalendarEvent[] = [
  { id: 'fair', day: '2026-11-10', start: 0, end: 1440, title: 'Seed fair', allDay: true, tone: 'pink' },
  { id: 'survey', day: '2026-11-25', start: 540, end: 600, title: 'Site survey', tone: 'green' },
  { id: 'plan', day: '2026-11-25', start: 660, end: 750, title: 'Planting plan' },
];

function SiteMonth({ openEvent }: { openEvent: (event: MonthCalendarEvent, anchor: HTMLElement) => void }) {
  const [month, setMonth] = useState('2026-11');
  return (
    <div className="flex h-full flex-col">
      <WeekCalendarToolbar
        end={
          <>
            <Button variant="ghost" onClick={() => setMonth('2026-11')}>
              Today
            </Button>
            <IconButton aria-label="Previous month" onClick={() => setMonth(step(month, -1))}>
              <IconButtonIcon icon="chevron-left" />
            </IconButton>
            <IconButton aria-label="Next month" onClick={() => setMonth(step(month, 1))}>
              <IconButtonIcon icon="chevron-right" />
            </IconButton>
          </>
        }
      />
      <MonthCalendar
        className="flex-1"
        aria-label="Site schedule"
        month={month}
        today="2026-11-25"
        events={EVENTS}
        onMonthChange={setMonth}
        onEventSelect={openEvent}
      />
    </div>
  );
}
```

- Fits: schedule: collection (time: point).
- height, width, padding, gap, corner, border, background, text: add no class for these.

## API reference

### MonthCalendar: every option

```tsx
import { MonthCalendar } from '@/components/ui/goop/month-calendar';
```

### Options

- aria-label: string — The calendar's name (`Field schedule`).
- month: string — The month shown, an ISO month (`2026-11`).
- events: readonly MonthCalendarEvent[] — The events; each sits on the day its `day` names (an ISO date), all-day ones first, then by their start.
- today?: string — Today, an ISO date: its number in the red square, `aria-current="date"`, and the first day focused in its month.
- weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6 = 0 — The weekday each row starts on: 0 (Sunday, the default) to 6.
- onMonthChange?: (month: string) => void — The keys asked for a day in another month (Page Up, Page Down, an arrow past the grid): that month, `2026-12`.
- onEventSelect?: (event: MonthCalendarEvent, anchor: HTMLElement) => void — An event pressed: the event, and what to open its card by (the chip, or the day's cell from its list).
- maxLines?: number — The lines a day shows before "N more"; left out, as many as its cell's height holds (3 when it cannot be read).
- openDay?: string | null — The day whose list is open (an ISO date, or null), held by you; left out, the calendar holds it.
- onOpenDayChange?: (day: string | null) => void — A day's list opened or closed: the day, or null.
- weekdayLabel?: (weekday: number) => string — A weekday's short name over its column (0 is Sunday): `Sun` by default.
- dayLabel?: (day: string) => string — A whole day in words, said to a reader (an ISO date): `Wednesday 25 November` by default.
- monthLabel?: (month: number) => string — A month's name (0 to 11), before the first day's number and in the grid's name: `November` by default.
- timeLabel?: (minutes: number) => string — A time's words on the timed events (minutes from midnight): `9:00 am` by default.
- messages?: Partial<MonthCalendarMessages> — What it says and writes, in your language: any of `MonthCalendarMessages`.
- container?: HTMLElement | null — Where a day's list is portalled (the end of `<body>` when left out).
- State: month (month / onMonthChange); openDay (openDay / onOpenDayChange); drawn by data-focus-visible
- Types: MonthCalendarEvent = WeekCalendarEvent

## Keyboard

- Tab: move to the grid's one stop (the focused day: today in its month, else the first), then through that day's events and its N more, then out
- ArrowLeft / ArrowRight: move to the day before or after, into the last or next month past the grid
- ArrowUp / ArrowDown: move a week back or on, into the last or next month past the grid
- Home / End: move to the first or last day of the week
- PageUp / PageDown: move to the same day a month back or on, asking for that month
- Enter / Space: on a day of one event, open it; on a day of several, open its list (in the narrow layout, move to the list under the grid); on an event, open it
- Escape: close the day's list, the focus back on the day

## Accessibility

- The native element answers the keyboard.
- hover: the browser's own (:hover): write nothing
- focus-visible: the attribute data-focus-visible

## Notes for AI

Give your coding agent this page as text instead of screenshots: the parts, the options, the states and the keys. An agent that reads the real part builds the real part, not a lookalike.

## Related

- [Button](/themes/meadow/components/button): A button with words that runs an action, in several looks and sizes, on a page, in a row or in a sidebar.
- [Icon button](/themes/meadow/components/icon-button): A button whose one visible label is a pack icon, for toolbars, rows and headers, with a spoken name.
- [Week calendar](/themes/meadow/components/week-calendar): A week of events by the hour, the days across and the hours down, with an all-day row.
- [Plan card](/themes/meadow/components/plan-card): One plan to pick on a pricing or billing page, with its price, what it holds and its button.
