# Event Calendar

> A month view calendar like Google Calendar's. Multi-day events run as bars across the days they cover, timed events sit as rows with a dot and start time, and full days show "+N more". Click an event for its time, place and your own actions, or open a day's agenda. Arrows move by day and week, Page Up and Down by month, and Enter opens the focused day. Months slide in the way you travel.

- Slug: `event-calendar`
- Category: [Calendars](https://www.assembli.design/category/calendars.md)
- Type: component
- Tags: calendar, month-view, events, schedule, agenda, scheduler, base-ui, keyboard
- npm dependencies: @base-ui/react, lucide-react, motion
- shadcn/ui dependencies: none
- Live preview: https://www.assembli.design/preview/event-calendar
- Page: https://www.assembli.design/components/event-calendar

![Event Calendar preview](https://www.assembli.design/thumbnails/event-calendar-light.png)

## Props

Other props pass through to the root element.

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `events` (required) | `CalendarEvent[]` |  |  |
| `month` | `Date` |  | Any date in the month to show. Uncontrolled by default. |
| `defaultMonth` | `Date` |  |  |
| `onMonthChange` | `(month: Date) => void` |  |  |
| `onDayClick` | `(day: Date) => void` |  | Called when a day is clicked, e.g. to start a new event on it. |
| `eventActions` | `(event: CalendarEvent) => React.ReactNode` |  | Rendered at the bottom of an open event, e.g. Edit and Delete buttons. |
| `action` | `React.ReactNode` |  | Buttons for the header, e.g. "New event". |
| `weekStartsOn` | `0 \| 1` | `0` | 0 = Sunday, 1 = Monday. |
| `maxEvents` | `number` | `3` | Event rows shown per day before "+N more". |
| `locale` | `string` |  |  |

## Install

One-time setup (needs a subscription):

1. Add the registry to the project's `components.json`: `{"@assembli":{"url":"https://www.assembli.design/r/{name}.json","headers":{"Authorization":"Bearer ${ASSEMBLI_API_KEY}"}}}` (merge into `"registries"`).
2. Put an API key from https://www.assembli.design/account in `.env.local` as `ASSEMBLI_API_KEY=asm_…`.

Then install with the shadcn CLI (writes `components/event-calendar/event-calendar.tsx` and installs dependencies):

```bash
npx shadcn@latest add @assembli/event-calendar
```

Registry item JSON: https://www.assembli.design/r/event-calendar.json (send `Authorization: Bearer <api key>`)

## Code

> Component source needs an Assembli subscription ($12/month or $96/year) and an API key sent as `Authorization: Bearer <key>`. To get one without copying anything, POST https://www.assembli.design/api/agent/login (or call the MCP tool connect_account), show the user the link it returns, and poll https://www.assembli.design/api/agent/token for the key. Or subscribe at https://www.assembli.design/pricing and create a key at https://www.assembli.design/account.
