Skip to content
GitHub (opens in a new tab)

Calendar

A full calendar of events by month, week, day, or list. Browse dates, filter calendars, add / edit / delete events.

stableMoleculecontracts/calendar.json

Preview

Calendar

A full calendar of events by month, week, day, or list. Browse dates, filter calendars, add, edit, or delete events. Not a date field — use DatePicker for that.

Master

Month around today. Click a day to add an event, an event to edit it, or +N more to open the day.

September 2026

Sun
Mon
Tue
Wed
Thu
Fri
Sat

Usage

Use Calendar for schedules: shifts, PTO, billing runs, meetings. Pass events and, if they belong to calendars, calendars. The toolbar has a month picker, New event, previous and next, Today, Calendars, and a Month / Week / Day / List switch. Month shows up to 3 events a day, then +N more. Week and Day show all-day events on top and timed events on an hourly grid. List shows the week’s events by day. Dates are local ISO: 2024-10-09 all-day, 2024-10-09T08:30 timed. Tones are brand, success, warning, danger, info, and accent. Do not pick a date in a form with this — use DatePicker. Do not put a primary Button in the toolbar; Save in the event form is the primary.

Do's

  • A schedule people browse by date: shifts, PTO, holidays, billing runs, meetings
  • Adding and editing dated events in place
  • Several calendars layered on one view, each in its own tone

Don'ts

<Calendar
  label="Team calendar"
  calendars={calendars}
  defaultEvents={events}
  onEventsChange={setEvents}
  defaultView="month"
  weekStart="sunday"
/>

When to use

  • A schedule people browse by date: shifts, PTO, holidays, billing runs, meetings
  • Adding and editing dated events in place
  • Several calendars layered on one view, each in its own tone

When not to use

  • Picking one date or a range in a form — use DatePicker
  • A timeline of one record — use Table or Timeline

What an agent reads

import { Calendar } from "agentic-ds-kit";
must
  • role=region named by label
  • Visible title (month, week, or day) is a heading and aria-live polite when it changes
  • Month is role=grid; one day is in the tab order; arrows move a day or a week; Home and End go to the week’s ends; Page Up and Page Down change the month; Enter opens a new event (or Day view when readOnly)
  • Day accessible name is the full date and event count
  • Every event is a button named title + time + calendar. Color is never the only cue
  • Month event chips, +N more, and day numbers are at least 24px tall
  • Icon-only Previous and Next are kit Buttons with a kit Tooltip; aria-labels name the step (month, week, or day)
  • The event form and the Calendars list open in a kit Drawer, which traps focus
  • +N more and the day numbers open Day view
  • built-in labels (chooseMonth, calendarView, month, allDay) come from KitLabelsProvider; English by default
defaults
  • label Calendar
  • defaultView month
  • weekStart sunday
  • startHour 7
  • readOnly false
  • headingLevel 2
stops if
  • Do not invent EventCalendar, Scheduler, MonthGrid, or DateGrid as public components
  • Do not use DatePicker for this schedule — DatePicker is a form date field
  • Do not put a primary Button in the toolbar; the event form’s Save is the primary action
  • Do not use raw hex or primitive --color-* ramps; pick a tone (brand, success, warning, danger, info, accent)
  • Do not use Calendar as a form control — use DatePicker
  • Do not ship a second month-grid Calendar in the catalog

From contracts/calendar.json: must is the a11y requirements, defaults the prop defaults, stops if the doNot rules where the agent asks instead of inventing a cousin.

Props

NameTypeRequiredDefaultNotes
labelstringNoCalendarNames the calendar region for screen readers.
eventsCalendarEvent[]No—Controlled events. start and end are local ISO: 2024-10-09 all-day, 2024-10-09T08:30 timed. An all-day end is the last day, inclusive. A timed event with no end lasts one hour. tone overrides the source calendar’s color.
defaultEventsCalendarEvent[]No—Starting events when the Calendar keeps changes itself.
onEventsChangefunctionNo—Called with the full new list after an event is created, edited, or deleted.
onEventClickfunctionNo—Called when an event is clicked, before the edit drawer opens (or instead of it when readOnly).
calendarsCalendarSource[]No—Sources. Color events, fill the event-form Calendar field, list in the Calendars drawer. hidden starts one hidden. Without calendars there is no Calendars button.
onViewChangefunctionNo——
viewsCalendarView[]No—Which views the switch offers, in order. Defaults to month, week, day, and list. With one view there is no switch.
datestringNo—Controlled focused date, YYYY-MM-DD. The view shows the month, week, or day around it.
defaultDatestringNo—The first focused date. Defaults to today.
onDateChangefunctionNo——
startHournumberNo7Week and Day open scrolled to this hour (0–23). The whole day can still be scrolled.
readOnlybooleanNofalseHides New event and turns off creating, editing, and deleting. Events can still be clicked through onEventClick.
headingLevelenumNo2Heading level of the visible range title (month, week, or day). Use 3 or 4 when the Calendar sits under a page or Section heading.
  • Component
    →

    DatePicker

    Form field that opens a month grid to pick one date.

  • Component
    →

    Table

    Simple semantic table for invoices, lists, and text rows, with optional sort, row menu, sticky header, loading, empty and error states, row dividers on or off, and one optional highlighted row.

  • Component
    →

    Timeline

    Vertical sequence of now, next, and later for ordered multi-stage work.

  • Component
    →

    Tabs

    Switch between related views in place.