Views

Toolbar and mini month

The Solid registry's toolbar, view switcher and mini month, which move the calendar through its dates and views.

Live. Step with the toolbar, or pick a date in the mini month.

The calendar item has three parts that move a calendar around:

PartFileWhat it does
CalendarToolbarcalendar-toolbar.tsxToday, previous and next period, and the title, with room for your own actions
ViewSwitcherview-switcher.tsxA select of the views, with a keyboard shortcut beside each one in the list
MiniMonthmini-month.tsxA month of dates that picks the calendar's date and shows the range the view does

Add them

Add the calendar item with the shadcn CLI, as UI source describes. A view such as list-view brings it with it, and it brings the controls it's built from:

npx shadcn@latest add @moltenship/calendar

Import the parts from where shadcn add puts them:

calendar-page.tsx
import { CalendarToolbar } from "@/components/calendar/calendar-toolbar";
import { MiniMonth } from "@/components/calendar/mini-month";
import { ViewSwitcher } from "@/components/calendar/view-switcher";

Use them

Render them inside Calendar.Root. The toolbar takes your calendar's parts, and the view switcher and the mini month read the calendar's state with its hooks:

calendar-page.tsx
const today = Temporal.PlainDate.from("2026-10-08");
const viewOptions = Calendar.views.map(({ name }) => ({ label: "Agenda", value: name }));

/** The view switcher, on the calendar's view. Inside `Calendar.Root`. */
function CalendarViewSwitcher() {
  const view = Calendar.useCalendarSelector((state) => state.view);
  const { setView } = Calendar.useCalendarActions();
  return <ViewSwitcher onValueChange={setView} options={viewOptions} value={view()} />;
}

/** The mini month beside the calendar: it shows the dates the view shows, and picks the date. */
function Sidebar() {
  const anchorDate = Calendar.useCalendarSelector((state) => state.anchorDate);
  const visibleRange = Calendar.useVisibleRange();
  const { setAnchorDate } = Calendar.useCalendarActions();
  return (
    <MiniMonth
      class="mx-auto max-w-60"
      locale="en-US"
      onSelectDate={(date) => setAnchorDate(date)}
      selectedDate={anchorDate()}
      today={today}
      visibleRange={visibleRange() ?? undefined}
      weekStartsOn={7}
    />
  );
}

export function CalendarWithToolbar() {
  return (
    <Calendar.Root
      defaultAnchorDate={today}
      defaultTimeZone="UTC"
      defaultView="agenda"
      events={events}
      locale="en-US"
      weekRules={{ firstDay: 7, minimalDays: 1, weekend: [6, 7] }}
    >
      {/* The mini month sits beside the calendar on a wide screen, and above it on a narrow one. */}
      <Calendar.Frame class="flex h-dvh flex-col md:flex-row">
        <aside class="shrink-0 border-b p-3 md:w-64 md:border-e md:border-b-0">
          <Sidebar />
        </aside>
        <main class="flex min-h-0 min-w-0 flex-1 flex-col">
          <CalendarToolbar calendar={Calendar} class="border-b">
            <Refresh onRefresh={() => new Promise((resolve) => setTimeout(resolve, 500))} />
            <CalendarViewSwitcher />
          </CalendarToolbar>
          <Calendar.Viewport class="min-h-0 flex-1">
            <Calendar.ActiveView />
          </Calendar.Viewport>
        </main>
      </Calendar.Frame>
    </Calendar.Root>
  );
}

CalendarToolbar reads calendar once, when it renders. Its children go at the end, after the title: put the view switcher and your own actions there, and pass start for content before the Today button, such as a sidebar toggle. Its buttons are the package's TodayTrigger, PreviousTrigger and NextTrigger, so they step by the view's own period and are named for screen readers.

ViewSwitcher doesn't know your views. Give it options, each a label, a value and an optional shortcut, the value that's chosen, and onValueChange. The shortcut shows in the list only, and the switcher binds no key to it.

MiniMonth doesn't read the calendar either, so it can sit outside Calendar.Root. It shows the month of selectedDate and follows it when it changes, marks today, and draws visibleRange as a band. onSelectDate gets the date a person picks.

Prop

Type

Keyboard

FocusKeyEffect
A mini month day← →Previous or next day
A mini month day↑ ↓The same day a week before or after
A mini month dayPage Up, Page DownThe same day a month before or after
A mini month dayEnter, SpacePick the day
The view select↓, ↑, Enter, SpaceOpen the list; then move through it and pick one
The view selectA letterThe next view whose label starts with it
The view selectEscapeClose the list, and keep the view

The mini month is one tab stop, and moving past its first or last day shows the month before or after. Its keys run before the calendar's, so it works inside Calendar.Frame too. Picking a view from the list puts focus back on the select.

Screen readers

The toolbar's Previous and Next buttons are named "Previous period" and "Next period", and their tooltips, which open after 400 ms on hover and on keyboard focus, label them. The view select is a combobox named "View", and its list a listbox. The trigger reads the view's label alone, without its shortcut.

The mini month is a grid named by its heading, "October 2026", which is a live region, so a screen reader hears the new month after a step. Each day is a button named by its full date, "Thursday, October 8, 2026". Today's is aria-current="date", and the selected day's cell is aria-selected.

Look

In a right-to-left page, the arrows point the other way and the buttons keep their places at the inline start and end. With reduced motion, the select's list and the tooltips fade in without growing. On a touch screen, every target is at least 24 px. The parts take their classes from calendar-toolbar.styles.ts and mini-month.styles.ts. Edit them to restyle the parts. A control's look lists every such file.

The words, such as "Today" and "Next month", are in navigation-labels.ts. Change them there to translate the parts.

On this page