Month
The Solid month, a grid of weeks with multi-day bars and a "+N more" popover, from the Solid registry.
The Solid demo opens on the month, with more events and a toolbar.
createMonthView shows every week that touches the month, starting on weekRules.firstDay. Most
months need five rows; some need four or six. The scrolling month swipes
up and down through the weeks a month at a time.
Add it
Add the month-view item to your app with the shadcn CLI, as
UI source describes. It brings the theme, the shared
calendar parts and the kit's popover:
npx shadcn@latest add @moltenship/month-viewThen register the view:
import {
createCalendar,
createCanonicalEventAdapter,
type CalendarEvent,
type CalendarEventChange,
} from "@moltenship/calendar-solid";
import { createSignal } from "solid-js";
import type { CalendarEventColor } from "@/components/calendar/event-colors";
import { createMonthView } from "@/components/calendar/month-view/month-view";
export type Event = CalendarEvent<{ readonly color: CalendarEventColor }>;
export const Calendar = createCalendar<Event>()({
eventAdapter: createCanonicalEventAdapter<{ readonly color: CalendarEventColor }>(),
views: [createMonthView<Event>({ getEventColor: (event) => event.data.color })],
});The view is named month. Previous and Next move by one month. Its weeks share the height they're
given, so give Calendar.Viewport a height, and save the changes a drag or a key proposes in
onEventChange:
export default function MonthPage() {
const [events, setEvents] = createSignal<readonly Event[]>(seed);
// A drag or a key proposes a change; saving it moves the event.
const save = (change: CalendarEventChange<Event, string, string>) => {
if (change.cause === "create") {
const event: Event = {
data: { color: "blue" },
id: crypto.randomUUID(),
title: "New event",
...change.proposed,
};
setEvents((all) => [...all, event]);
} else if (change.cause !== "delete") {
setEvents((all) =>
all.map((event) =>
event.id === change.eventId ? { ...event, ...change.proposed } : event,
),
);
}
};
return (
<Calendar.Root
defaultAnchorDate={Temporal.PlainDate.from("2026-10-08")}
defaultTimeZone="UTC"
defaultView="month"
events={events()}
locale="en-US"
onEventChange={save}
viewOptions={{ month: { dragPreview: "free" } }}
weekRules={{ firstDay: 7, minimalDays: 1, weekend: [6, 7] }}
>
{/* The weeks share the viewport's height, and show as many events as fit. */}
<Calendar.Frame class="flex h-dvh flex-col">
<h1 class="p-4 text-lg font-semibold">
<Calendar.Title />
</h1>
<Calendar.Viewport class="min-h-0 flex-1">
<Calendar.ActiveView />
</Calendar.Viewport>
</Calendar.Frame>
</Calendar.Root>
);
}Options
Pass them to createMonthView, or per root in viewOptions, as the page above does with
dragPreview:
Prop
Type
What it shows
- Days: weekday names across the top. Days outside the month are muted, today's date sits in a
filled circle and is
aria-current="date", and the first of each month reads "Oct 1". - Multi-day and all-day events are bars across the days they cover. A bar that continues into the previous or next week ends with a chevron. Timed bars start with their start time.
- Single-day timed events show a colored dot, the start time and the title.
- "+N more": rows grow to fill the height they're given, at least 80 px each, and show as many events as fit. The rest collapse into "+N more", which opens a popover with the day's events.
- Closed days, from the root's
availability, are shaded, and a screen reader hears "closed" in the day's name, after its exception's label if it has one: "Friday, October 9, 2026, Offsite, closed, 2 events". - Clicking a date number opens that day in the view named
day. Register the registry's day view, or a view of your own by that name, so the click has somewhere to go. - Editing: with
onEventChangeonRoot, drag an event to another day (timed events keep their time), or drag across days to create an all-day event. Escape cancels a drag. Each change runs your policies andonEventChange, and a screen reader hears where the event lands. - Changes being saved: events with a pending change, the ones
useCalendarPendingChangesreturns, getaria-busyand render at 60% opacity. - On a phone events become small tinted blocks, every date and event is at least 24 px tall, and a long press doesn't select their text.
- Right to left mirrors the grid, the chevrons included, when the page or
Calendar.Framehasdir="rtl". - Reduced motion opens the popover without its scale and slide.
A drag changes only the pointer layer's ghosts: the weeks and their events don't render again until the change is saved.
Anatomy
MonthView renders the parts below. The view builds them itself from its projection, so they're not
parts you compose: to change one, edit its file under components/calendar/month-view.
MonthView month-view.tsx
├── Weekday header
└── MonthWeekRow month-week.tsx, one per week
└── MonthDayCell a gridcell, one per day
├── UnavailableTime the shading of a closed day
├── Date layer data-date
│ └── DateButton aria-current="date" on today
├── MonthEvent month-event.tsx, one per event that starts that day
└── MoreEvents "+N more" and the kit's popover, with the day's eventsThe .tsx files are Solid components. What they render comes from plain TypeScript beside them:
| File | Holds |
|---|---|
month.styles.ts | Every class the parts set, so a restyle is one file |
month-labels.ts | The dates, start times, cell names and the "+N more" words |
month-layout.ts | How many lanes fit in a week, measured from the grid, and which days are closed |
A bar is a MonthEvent with bar set. startsBefore and endsAfter mark the ends that continue
into another week.
Keyboard
| Focus | Key | Effect |
|---|---|---|
| A day | ← → | Previous or next day |
| A day | ↑ ↓ | Same weekday a week earlier or later |
| A day | Home, End | First or last day of the week |
| A day | Page Up, Page Down | Same day in the previous or next month |
| A day | Enter | Go into the day's events. ↑ ↓ walk them, and Escape goes back to the day |
| A day | Shift+Enter | Open the day in the day view |
| A day | Space | Start an all-day event there. Arrow keys extend it, and Enter saves it |
| An event | Space | Pick it up. Arrow keys move it by days, Enter saves, and Escape cancels |
| An event | Shift+Space | Pick up its end to resize it by days. Shift+Space again switches to its start |
The grid is one tab stop. Events behind "+N more" are reachable too: while focus is on one, its week shows every event. After a drop, focus stays on the moved event.
Markup for interactions
The view connects the pointer layer for you. If you change its markup, keep the attributes it reads:
each MonthDayCell holds an element with data-date underneath its events, and each event is a
<button> with data-event-id. The events sit beside that element, not inside it, so a drag over
a bar still finds the day under the pointer.