Customization

How much of the calendar's UI is yours to change, from its tokens to every element on screen, built on the unstyled parts and hooks.

Time's packages are headless. They hold the engine, the calendar's state and actions, and parts and hooks that render plain elements, and they ship no CSS. Everything on screen is yours: your markup, your classes, your design system's components.

The registry has styled views for the week and day, the month, the year and the agenda, each but the year also as a scrolling view, the resource columns and the resource timeline, with a toolbar and a mini month and the controls they're built from. They come as source files you own, with a theme of color tokens. UI source adds them, Theming changes their tokens and each control's look, and Controls swaps a control for your own. This page is about the UI you write yourself.

Build your own UI

Your app installs the packages, writes its own markup or uses any library's components, and connects them to the calendar through parts and hooks:

  • Parts. Frame, Toolbar, Title, Viewport and the previous, next and today triggers each render one plain element with a data-calendar-part attribute. They take class, style, ref and event handlers, and bring no class or style of their own. Components lists them.
  • Hooks. useCalendarActions() returns navigateNext, setView, proposeEventChange and the other actions, for controls of your own. useCalendarSelector and the other hooks read the state.
  • Views. A custom view is a strategy, which picks the dates and the events, and a Renderer, which is your component.

This calendar uses plain elements and class names from the app's own CSS:

booking-calendar.tsx
import {
  createCalendar,
  defineCalendarView,
  defineEventAdapter,
  plainDateInterval,
  type CalendarViewProjectionInput,
} from "@moltenship/calendar-solid";
import { For } from "solid-js";

export interface Booking {
  readonly id: string;
  readonly title: string;
  readonly start: Temporal.Instant;
  readonly end: Temporal.Instant;
}

const eventAdapter = defineEventAdapter<Booking>()({
  getId: (booking) => booking.id,
  getTitle: (booking) => booking.title,
  getInterval: (booking) => ({ kind: "timed", start: booking.start, end: booking.end }),
  getResourceIds: () => [],
});

// The strategy picks the dates and the bookings. The Renderer is your markup.
const weekView = defineCalendarView({
  name: "week",
  strategy: {
    getRange: (anchor) => plainDateInterval(anchor, anchor.add({ days: 7 })),
    navigate: (anchor, delta) => anchor.add({ weeks: delta }),
    getTitle: (range, { locale }) => range.start.toLocaleString(locale, { dateStyle: "medium" }),
    project: ({ snapshot, instantRange }: CalendarViewProjectionInput<undefined, Booking>) =>
      snapshot.queryTimed(instantRange),
  },
  Renderer: (props) => (
    <ul class="booking-list">
      <For each={props.projection}>
        {(item) => (
          <li>
            <time datetime={item.event.start.toString()}>
              {item.event.start.toLocaleString(props.environment.locale, {
                dateStyle: "medium",
                timeStyle: "short",
                timeZone: props.environment.timeZone,
              })}
            </time>{" "}
            {item.event.title}
          </li>
        )}
      </For>
    </ul>
  ),
});

export const Calendar = createCalendar<Booking>()({ eventAdapter, views: [weekView] });

function Toolbar() {
  const actions = Calendar.useCalendarActions();

  return (
    <Calendar.Toolbar class="toolbar">
      {/* A control of your own calls an action. */}
      <button class="button" type="button" onClick={(event) => actions.navigateToday({ event })}>
        Today
      </button>
      {/* The calendar's triggers are plain buttons that take your classes. */}
      <Calendar.PreviousTrigger class="button">Previous</Calendar.PreviousTrigger>
      <Calendar.NextTrigger class="button">Next</Calendar.NextTrigger>
      <Calendar.Title class="title" />
    </Calendar.Toolbar>
  );
}

export function BookingCalendar(props: { readonly bookings: readonly Booking[] }) {
  return (
    <Calendar.Root
      events={props.bookings}
      defaultAnchorDate={Temporal.PlainDate.from("2026-10-05")}
      defaultTimeZone="Europe/Berlin"
      label="Bookings"
      locale="en-US"
      weekRules={{ firstDay: 1, minimalDays: 4, weekend: [6, 7] }}
    >
      <Calendar.Frame class="calendar">
        <Toolbar />
        <Calendar.Viewport>
          <Calendar.ActiveView />
        </Calendar.Viewport>
      </Calendar.Frame>
    </Calendar.Root>
  );
}

A library's components go where the plain elements are. The Today button can be your library's Button with the same onClick. Pass the click's event as event, so a state handler hears how the person caused the change.

@ui-sdk/core and @ui-sdk/solid are peer dependencies. The calendar's state, its actions and what an agent reads are written on ui-sdk, and ui-sdk's parts are unstyled too. Installing them adds no look to your page and doesn't decide which components you use.

You keep the engine, the state, saving changes with policies and pending state, and the actions an agent calls: an agent bridge lists a calendar that renders Frame, whatever draws its views. You write the rest:

  • The views. The packages export the functions that lay a view out, such as projectMonth and projectList. Your view's project calls them, and your Renderer draws the result.
  • Dragging. useCalendarPointer turns drags in your markup into changes, from a few data-* attributes.
  • Keyboard support and announcements. In your own views has the hooks, and Calendar.Announcer speaks the changes.

What it costs

  • The views are yours to write and test. That includes laying out overlapping events, keyboard navigation, dragging and screen reader announcements. The packages give you the functions and hooks for each.
  • An agent sees less of a control that isn't built on ui-sdk. An agent bridge lists ui-sdk's components. A control of your own is there only as far as your component tells the bridge, and a control from a library that isn't built on ui-sdk tells it nothing. The calendar stays on the bridge either way, so an agent still navigates and changes the view with the calendar's own actions.

On this page