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 is a headless core and one ready-made UI on top of it.

  • The core is the npm packages. They hold the engine, the calendar's state and actions, and parts and hooks that render plain elements. They ship no CSS.
  • The UI is the registry. It's a set of React source files built on those packages: the views, the toolbar, a kit of controls and a theme, in Tailwind CSS on shadcn/ui's tokens or in StyleX. shadcn add copies them into your app, and from then on they are your code.

Nothing in the packages depends on the registry. So every part of that UI is yours to change or replace, and an app on MUI, Mantine or its own design system uses the same packages without it.

There are four levels, from the least work to the most:

LevelYou changeWhereWhat it costs
1. Set tokensColors, the event palette, sizesYour global CSSNothing
2. Edit the filesMarkup, classes, layout, a view's behaviourcomponents/calendar/A merge when a file you edited gets an update
3. Swap the controlsThe buttons, tooltips, popovers and the restcomponents/calendar/ui/That merge, and an agent sees less of your controls
4. Build your own UIEverything on screenYour own componentsYou write the views, with their keyboard support and their dragging

What each level costs has the details.

The levels mix. One calendar can show the registry's month view, a toolbar you edited and a view you wrote.

Level 1: set tokens

The registry's views read their colors and sizes from CSS variables. Override them in your own CSS:

globals.css
:root {
  --calendar-today: oklch(0.55 0.17 150);
  --calendar-hour-height: 4rem;
}

.dark {
  --calendar-today: oklch(0.72 0.15 150);
}

Most calendar tokens derive from the shadcn tokens, so an app with its own shadcn theme gets a calendar in its colors before it writes a rule. Theming lists every token, and the Theme builder shows your changes live and gives you the CSS to paste. The StyleX items have the same tokens as StyleX variables, which Change the tokens covers.

You keep everything, updates included. shadcn add writes the theme's own block again each time, and your rules sit outside that block. Tokens change colors, the event palette, the hour height and the event padding. They don't change markup or layout.

Level 2: edit the files you added

shadcn add puts source files in components/calendar/: a folder for each view, the toolbar, the view switcher and the event chip beside them, and the controls in ui/. Open a file and change it. The toolbar's tooltips open after 400 ms, for example. To open them sooner, change the default in the tooltip's file:

components/calendar/ui/tooltip.styles.ts
export const tooltipDefaults = { delay: 150, sideOffset: 4 } as const;

The same goes for a view's markup, the toolbar's layout in calendar-toolbar.tsx, and a control's classes in its *.styles.ts file.

Updates

The files are copies, so a fix in the registry reaches your app when you add the item again:

npx shadcn@latest add https://time.molten.sh/r/month-view.json

The command goes through the item's files and the files of the items it builds on. It writes a file your app doesn't have, skips a file that matches the registry's, and asks before it replaces a file that differs. Answer no to keep yours. --overwrite replaces every file without asking, with any edits you made.

To see what the command would do before it writes anything, add --dry-run. It lists each file as create, skip (identical) or overwrite, which marks a file that differs. --diff with a path from that list prints the difference between your file and the registry's, and writes nothing either:

npx shadcn@latest add https://time.molten.sh/r/month-view.json --dry-run
npx shadcn@latest add https://time.molten.sh/r/month-view.json \
  --diff components/calendar/month-view/month-view.tsx

The diff compares the two files as they are now, so it shows your edits and the registry's changes together. To separate them, commit your work, let shadcn add replace the file, and put your edits back from git diff.

You keep the registry's UI and everything it does. You take on that merge for each file you edited. Files you didn't touch update without a question.

Level 3: swap the controls

The Tailwind views take their controls from button.tsx, badge.tsx, tooltip.tsx, select.tsx, popover.tsx, dialog.tsx and toast.tsx in components/calendar/ui/: the buttons, badges, tooltips, view select, popovers, the recurrence dialog and the undo toast. Since 2.0 those controls are built on ui-sdk, and they are a default. The views import them from those files only and use them through a short list of props. To use a control of your own, replace the body of its file and keep the names it exports. With shadcn's button:

components/calendar/ui/button.tsx
import type { ComponentProps } from "react";

import { Button as AppButton, buttonVariants } from "@/components/ui/button";

export type ButtonProps = ComponentProps<typeof AppButton>;

export function Button(props: ButtonProps) {
  return <AppButton {...props} />;
}

export { buttonVariants };

Every view now renders your button, and no view's file changes. Use your own controls lists what the views import from each file and the props they pass, and how to give a shadcn popover the handle that one popover for many triggers needs.

This is an edit like any other, so shadcn add asks before it replaces the file. Swapping also has two costs of its own.

Level 4: build your own UI

Your app adds nothing from the registry at this level. It 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 className, 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:

meeting-calendar.tsx
// The strategy picks the dates and the meetings. 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, Meeting>) =>
      snapshot.queryTimed(instantRange),
  },
  Renderer: ({ projection, environment }) => (
    <ul className="meeting-list">
      {projection.map(({ event }) => (
        <li key={event.id}>
          <time dateTime={event.start.toString()}>
            {event.start.toLocaleString(environment.locale, {
              dateStyle: "medium",
              timeStyle: "short",
              timeZone: environment.timeZone,
            })}
          </time>{" "}
          {event.title}
        </li>
      ))}
    </ul>
  ),
});

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

function Toolbar() {
  const { navigateToday } = Calendar.useCalendarActions();

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

export function MeetingCalendar({ meetings }: { readonly meetings: readonly Meeting[] }) {
  return (
    <Calendar.Root
      events={meetings}
      defaultAnchorDate={Temporal.PlainDate.from("2026-10-05")}
      defaultTimeZone="Europe/Berlin"
      label="Team meetings"
      locale="en-US"
      weekRules={{ firstDay: 1, minimalDays: 4, weekend: [6, 7] }}
    >
      <Calendar.Frame className="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 native event as event, so a state handler hears how the person caused the change. A button that can render another element in its place can render one of the calendar's triggers instead, as the registry's toolbar does with <Button render={<TodayTrigger aria-label="Today" />}>.

@ui-sdk/core and @ui-sdk/react are peer dependencies since 2.0. 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 registry's views get their layouts from functions the packages export, such as projectMonth and projectList. Your view's project can call the same ones, 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.

A Solid app can start at any level: the Solid registry has every view, and the Solid quick start builds a calendar at this one.

What each level costs

  • An edited file takes a merge. From level 2 on, shadcn add no longer updates a file you changed without asking. You bring the registry's fixes into that file yourself, as Updates describes.
  • An agent sees less of a control that isn't built on ui-sdk. An agent bridge lists ui-sdk's components. The kit's buttons and view select are entries in that list. 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, such as stock shadcn or MUI, tells it nothing. The calendar stays on the bridge at every level, so an agent still navigates and changes the view with the calendar's own actions.
  • A React control needs a Solid twin. ui-sdk has the same components in React and Solid, so a control built on it behaves alike in both. A control built on a React library exists in React only, so a Solid app needs its own version of it. The Solid registry's views use its own kit, so that matters only for a control of yours.
  • At level 4, 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, and the registry's views are source you can read while you write yours.

On this page