Concepts

Anatomy

The parts a calendar is built from, and their names in code.

A calendar is made of the parts your createCalendar factory returns, such as Calendar.Toolbar, and the views you register. This one puts every structural part together. TeamCalendar is the calendar from the views overview, with an agenda and a month grid:

team-calendar-app.tsx
import { For } from "solid-js";

import { seed, weekRules } from "./app";
import { TeamCalendar as Calendar, type TeamView } from "./team-calendar";

const viewLabels: Record<TeamView, string> = { list: "Agenda", month: "Month" };

export function TeamCalendarApp() {
  return (
    <Calendar.Root
      label="Team calendar"
      events={seed}
      defaultAnchorDate={Temporal.PlainDate.from("2026-10-08")}
      defaultTimeZone="Europe/Berlin"
      locale="en-US"
      weekRules={weekRules}
    >
      <Calendar.Frame>
        <Calendar.Toolbar>
          <Calendar.TodayTrigger>Today</Calendar.TodayTrigger>
          <Calendar.PreviousTrigger aria-label="Previous period">‹</Calendar.PreviousTrigger>
          <Calendar.NextTrigger aria-label="Next period">›</Calendar.NextTrigger>
          <Calendar.Title />
          <Calendar.ViewSwitcher aria-label="View" getViewLabel={(name) => viewLabels[name]} />
        </Calendar.Toolbar>
        <Calendar.Viewport>
          <Calendar.ActiveView fallback={<p>This view isn't registered.</p>} />
        </Calendar.Viewport>
      </Calendar.Frame>
    </Calendar.Root>
  );
}
  • Root holds the calendar's state and renders no element of its own. Every part and hook works anywhere inside it.
  • Frame is the calendar's <section>. Root's label names it, for screen readers and for an agent.
  • Toolbar, Title, Viewport and the three triggers each render one element. A trigger needs text or an aria-label.
  • ViewSwitcher is a plain <select> with one option per registered view. To draw your own control, see Switching views.
  • ActiveView renders the active view's Renderer inside the viewport.

The parts bring no styles. Each renders its element with a data-calendar-part attribute, such as data-calendar-part="today-trigger", so the look is your CSS. They take the element's own props in Solid's spelling: class, not className. The component reference lists every part.

What the parts render

<section data-calendar-part="frame" aria-label="Team calendar">
  <header data-calendar-part="toolbar">
    <button data-calendar-part="today-trigger">Today</button>
    <button data-calendar-part="previous-trigger" aria-label="Previous period">‹</button>
    <button data-calendar-part="next-trigger" aria-label="Next period">›</button>
    <span data-calendar-part="title">Oct 5 – 18, 2026</span>
    <select data-calendar-part="view-switcher" aria-label="View">
      …
    </select>
  </header>
  <div data-calendar-part="viewport">
    <!-- what the active view's Renderer returns -->
  </div>
</section>

Two more parts sit beside these. Calendar.Event looks one event up by its ID and hands it to its children, and Calendar.Announcer is the live region that speaks keyboard and pointer gestures.

Views

ActiveView draws the rest, and a view's markup is its own. Custom views writes one from a strategy and a Renderer.

On this page