---
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/"
---

# Week calendar

A week of events by the hour, the days across and the hours down, with an all-day row, for React and Tailwind CSS. Part of Goop Pro.

Pro. Its export: `WeekCalendar`.

## When to use

- A week of events by the hour, the days across and the hours down, with an all-day row.
- Use it for timed events by day and hour, never a grid of boxes by hand. Give it a box with a height (it scrolls its hours inside itself) and a `WeekCalendarToolbar` over it.

## 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 Week 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-week-calendar.json --yes
```

```text
Add the Goop Week 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 { WeekCalendar, type WeekCalendarEvent, WeekCalendarToolbar } from '@/components/ui/goop/week-calendar';

const daysOf = (week: number) =>
  ['Mon', 'Tue'].map((name, index) => {
    const day = new Date(Date.UTC(2026, 10, 23 + week * 7 + index));
    return { id: day.toISOString().slice(0, 10), name, date: String(day.getUTCDate()) };
  });
const ZONES = [{ id: 'utc', label: 'UTC', hourLabel: (hour: number) => `${hour}:00` }];

function SiteWeek() {
  const [week, setWeek] = useState(0);
  const [events, setEvents] = useState<WeekCalendarEvent[]>([
    { id: 'kit', day: '2026-11-23', start: 0, end: 1440, title: 'Kit check', allDay: true, flag: true },
    { id: 'survey', day: '2026-11-23', start: 540, end: 600, title: 'Site survey', tone: 'green' },
  ]);
  return (
    <div className="flex h-full flex-col">
      <WeekCalendarToolbar
        end={
          <>
            <Button variant="ghost" onClick={() => setWeek(0)}>
              Today
            </Button>
            <IconButton aria-label="Next week" onClick={() => setWeek(week + 1)}>
              <IconButtonIcon icon="chevron-right" />
            </IconButton>
          </>
        }
      />
      <WeekCalendar
        className="flex-1"
        aria-label="Site schedule"
        days={daysOf(week)}
        events={events}
        timeZones={ZONES}
        defaultAllDayOpen
        onEventChange={(event, next) =>
          setEvents((all) => all.map((item) => (item.id === event.id ? { ...item, ...next } : item)))
        }
      />
    </div>
  );
}
```

- Fits: schedule (its recipe); schedule: collection (time: slot).
- WeekCalendarToolbar: Stand it over the `WeekCalendar`; keep controls that belong together in one `div`, so they wrap as one.
- height, width, padding, gap, corner, border, background, shadow, text, motion: add no class for these.

## API reference

### Parts

- `WeekCalendarToolbar` — The row over the calendar; its props: week-calendar--toolbar.md

### WeekCalendar: every option

```tsx
import { WeekCalendar } from '@/components/ui/goop/week-calendar';
```

### Options

- aria-label: string — The calendar's name (`Field schedule`).
- days: readonly WeekCalendarDay[] — The days, in order: the week (or any run of days) the caller shows.
- events: readonly WeekCalendarEvent[] — The events; each sits on the day its `day` names, by its `start` and `end` (or in the all-day row).
- view?: 'week' | 'day' = 'week' — `week` (the default) shows every day; `day` shows the one `date` names.
- date?: string — The day `view="day"` shows, and where the empty-time slot starts (a day's id); the first day when left out.
- now?: { day: string; at: number; label: string } — The time now: its day, its minute from midnight and its words (`8:19 am`), the red line and words.
- hourHeight?: number = 64 — An hour's height in px (64 by default: a quarter hour is 16 px).
- from?: number = 480 — The minute scrolled to the top as it opens (`480`, 8:00, by default).
- dayStart?: number = 0 — The first hour drawn (0, midnight, by default): a working day's calendar starts later (`7`).
- dayEnd?: number = 24 — The hour the day drawn ends at (24 by default): a working day's calendar ends earlier (`19`).
- createLength?: number = 30 — A new event's length, in minutes, made by the keyboard or a double-click (30 by default).
- eventTime?: 'start' | 'range' = 'start' — What a card's time reads: `start` (the default) its start, `range` its start and end (`9:00 am – 10:00 am`): the end beside the start where the card is wide enough, under it where the card is tall enough, else left off whole.
- hourLabel?: (hour: number) => string — An hour's words in the gutter (0 to 23): `7 am` by default.
- timeLabel?: (minutes: number) => string — A time's words on the cards, the ghosts and to a reader: `9:00 am` by default.
- messages?: Partial<WeekCalendarMessages> — What it says and writes, in your language: any of `WeekCalendarMessages`.
- onEventChange?: (event: WeekCalendarEvent, next: WeekCalendarRange) => void — A move or a resize dropped: the event and where it now goes.
- onEventCreate?: (event: WeekCalendarNewEvent) => void — An event made (a drag across empty time, a double-click on it, or the slot's Enter, then the create card's Create).
- onEventSelect?: (event: WeekCalendarEvent) => void — An event pressed (a click with no drag; a click, Enter or Space on an all-day chip, a button only with this): open your card on it.
- timeZones?: readonly WeekCalendarTimeZone[] — The gutter's time zones, in order: one column of hour words each, their names in the corner.
- onAddTimeZone?: () => void — Draws the corner's plus, and hears its press.
- onTimeZoneSelect?: (zone: WeekCalendarTimeZone) => void — Makes each zone's name in the corner a button, and hears its press.
- allDayOpen?: boolean — Whether the all-day row is open, held by you; this or either of the next two draws the row's button.
- defaultAllDayOpen?: boolean — Whether the all-day row starts open, held by the calendar; draws its button.
- onAllDayOpenChange?: (open: boolean) => void — The all-day row's button pressed: what it asks for.
- container?: HTMLElement | null — Where the create card is portalled (the end of `<body>` when left out).
- State: allDayOpen (allDayOpen / defaultAllDayOpen / onAllDayOpenChange)
- Types: WeekCalendarDay = { id: string; name: string; date?: string; label?: string; today?: boolean; weekend?: boolean }; WeekCalendarEvent = { id: string; title: string; allDay?: boolean; tone?: WeekCalendarTone; done?: boolean; flag?: boolean }; WeekCalendarRange = { day: string; start: number; end: number }; WeekCalendarNewEvent = { title: string }; WeekCalendarTimeZone = { id: string; label: string; hourLabel: (hour: number) => string }

### WeekCalendarToolbar

The row over the calendar.

```tsx
import { WeekCalendarToolbar } from '@/components/ui/goop/week-calendar';
```

### Options

- start?: ReactNode — At the row's start: where you are (the theme's `Breadcrumb`).
- end?: ReactNode — At the row's end: what you can do (Today, previous and next, pickers, the page's own action).

## Keyboard

- Tab: move through the corner's plus and zone names and the all-day button where drawn, then each all-day chip (a button where `onEventSelect` is given), then to the events (one stop: the last one focused), then to the empty-time slot
- ArrowUp / ArrowDown: move to the event before or after in the same day; with an event picked up, move it 15 minutes; on the slot, move it 15 minutes
- ArrowLeft / ArrowRight: move to the nearest event in the day before or after; with an event picked up, move it a day; on the slot, move it a day
- Shift+ArrowUp / Shift+ArrowDown: with an event picked up, move its end 15 minutes
- Home / End: move to the first or last event
- Enter / Space: on the corner's plus or a zone's name, press it; on the all-day button, close or open the row; on an all-day chip given `onEventSelect`, press it; pick the focused event up, or drop the one picked up; on the slot, open the create card there
- Escape: put a picked-up event back where it was; close the create card

## Accessibility

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

## Motion

- The part sets its own motion: add no transition or animation of your own.

## 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.

Shortened to fit: the data-slot values.

## 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.
- [Tool call](/themes/meadow/components/tool-call): One tool call of an assistant's run, as a quiet row that opens onto its input and output.
- [Tab bar](/themes/meadow/components/tab-bar): A phone screen's bottom navigation.
