Calendar Section
A self-contained calendar component that displays Google Calendar events in a modern monthly grid view. Features client-side data fetching, dynamic month navigation, event categorization, and detailed event viewing.
A self-contained calendar component that displays Google Calendar events in a modern monthly grid view. Features client-side data fetching, dynamic month navigation, event categorization, and detailed event viewing.
- sectionType: calendar
calendars:
apiKey: 'YOUR_GOOGLE_CALENDAR_API_KEY'
calendars:
- id: 'en.usa#holiday@group.v.calendar.google.com'
name: 'US Holidays'
category: 'holiday'
text:
title: 'Event Calendar'
prose: 'View upcoming events and important dates'
View upcoming events and important dates. Replace YOUR_GOOGLE_CALENDAR_API_KEY above with your own API key to see live data.
Loading calendar events...
For reusable configurations, you can use an external data file:
- sectionType: calendar
calendars:
source: 'holidays' # References lib/data/calendars/holidays.json
- sectionType: calendar
containerFields:
inContainer: true
background:
color: 'var(--color-background-light)'
calendars:
source: 'team-events'
text:
title: 'Team Schedule'
Define the calendar configuration directly in your page YAML:
- sectionType: calendar
containerTag: section
calendars:
apiKey: 'YOUR_GOOGLE_CALENDAR_API_KEY'
calendars:
- id: 'en.usa#holiday@group.v.calendar.google.com'
name: 'US Holidays'
category: 'holiday'
- id: 'your-calendar@gmail.com'
name: 'Personal Events'
category: 'personal'
text:
title: 'Event Calendar'
prose: 'View upcoming events'
For reusable configurations across multiple pages, create a data file in lib/data/calendars/[name].json:
{
"apiKey": "YOUR_GOOGLE_CALENDAR_API_KEY",
"calendars": [
{
"id": "en.usa#holiday@group.v.calendar.google.com",
"name": "US Holidays",
"category": "holiday"
},
{
"id": "your-calendar@gmail.com",
"name": "Personal Events",
"category": "personal"
}
]
}
Then reference it in your page:
- sectionType: calendar
calendars:
source: 'holidays' # Loads lib/data/calendars/holidays.json
For public calendars:
Common public calendars:
en.usa#holiday@group.v.calendar.google.comen.uk#holiday@group.v.calendar.google.comen.canadian#holiday@group.v.calendar.google.comThe component includes four built-in category styles:
Custom categories can be added by extending the CSS with additional .calendar__event--{category} classes.
| Property | Type | Required | Description |
|---|---|---|---|
calendars.apiKey | string | Yes* | Google Calendar API key (inline config) |
calendars.calendars | array | Yes* | Array of calendar objects (inline config) |
calendars.source | string | Yes* | Name of JSON file in lib/data/calendars/ (external config) |
*Either inline (apiKey + calendars) OR external (source) is required
| Property | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Google Calendar ID |
name | string | No | Display name for the calendar |
category | string | No | Category for styling (default, holiday, personal, work) |
| Property | Type | Required | Description |
|---|---|---|---|
text.title | string | No | Calendar section title |
text.prose | string | No | Optional description text |