Accessibility
The keyboard map, screen reader announcements, the ARIA patterns each view uses, reduced motion, and right-to-left layout.
Everything a pointer does in a view, the keyboard does too: move around, open an event, and move, resize, or create one. A screen reader hears each step. The keys and the announcements are the calendar's, and a view you write binds them with three hooks, as In your own views shows.
Try it on the registry's month: Tab into the calendar or click a day, then use the keys below. The strip under the calendar shows what a screen reader announces.
Keyboard
Each view is one tab stop. Tab enters it on the day, slot, or event you last focused, or on today, and the keys below move focus inside it. Moving past the visible range navigates the view. Inside a view, arrow, Home, End, and Page keys always belong to the view, so they never trigger your app's own shortcuts, even where there's nowhere to move.
Moving around
The table is the engine's key maps, one per layout. A view gets the rows of the map its strategy
names in getSpatialNavigation: monthSpatialNavigation for Month, yearSpatialNavigation for
Year, timeGridSpatialNavigation for Week and day, resourceColumnsSpatialNavigation for
Resources, resourceTimelineSpatialNavigation for Timeline and listSpatialNavigation for Agenda.
| View | Focus | Key | Effect |
|---|---|---|---|
| All | Outside the view | Tab | Enter the view |
| All | An event | Enter | Open it: the element's own click, such as the demo's popover |
| All | An event | Escape | Back to its day (month, all-day row) or the slot it starts in (week, day) |
| All | A day, slot, or agenda event | Shift+Enter | Open that date in the day view |
| Month | A day | ← → | Previous or next day |
| Month | A day | ↑ ↓ | Same weekday a week earlier or later |
| Month | A day | Home, End | First or last day of the week |
| Month | A day | Page Up, Page Down | Same day in the previous or next month |
| Month | A day | Enter | Go into the day's events |
| Month | An event | ↑ ↓ | Previous or next event of the day; past the ends, to the day itself or the next week |
| Year | A day | ← → ↑ ↓ | Previous or next day, or the same weekday a week away, across months |
| Year | A day | Home, End | First or last day of the week's row in its month |
| Year | A day | Page Up, Page Down | Same day in the previous or next month |
| Year | A day | Enter, Space | Open the day's events in a popover; Escape returns to the day |
| Week, day | An all-day cell | ↓ | First slot of the day |
| Week, day | A slot | ↑ ↓ | Previous or next 15-minute slot; up from the first slot, the all-day cell |
| Week, day | A day or slot | ← → | Same slot on the previous or next day |
| Week, day | A day or slot | Home, End | First or last day shown |
| Week, day | A day or slot | Page Up, Page Down | Back or forward a whole week (or day) |
| Week, day | A slot | Enter | The event covering it |
| Week, day | An all-day cell | Enter | Go into the day's all-day events |
| Week, day | A timed event | ↑ ↓ | Previous or next event in the column |
| Week, day | A timed event | ← → | The event beside it that overlaps it |
| Resources | A day or slot | ← → | Same slot in the previous or next column, crossing into the next resource |
| Resources | A day or slot | Home, End | First or last column |
| Resources | A day or slot | Page Up, Page Down | Same resource, a whole day (or range) earlier or later |
| Timeline | A day or slot | ← → | Previous or next day, or half hour in the day timeline |
| Timeline | A day or slot | ↑ ↓ | The same time in the previous or next resource's row |
| Timeline | A day or slot | Home, End | First or last day or half hour shown |
| Timeline | A day or slot | Page Up, Page Down | Back or forward a whole day, week, or month |
| Timeline | A day or slot | Enter | The events covering it in that row |
| Timeline | A group's day or slot | Shift+Enter | Expand or collapse the group |
| Timeline | An event | ← → | Previous or next event in the row |
| Timeline | An event | ↑ ↓ | The cell at its start in the previous or next row |
| Agenda | An event | ↑ ↓ | Previous or next event |
| Agenda | An event | Page Up, Page Down | First event of the previous or next day |
| Agenda | An event | Home, End | First or last event |
| Agenda | A range without events | ↑ or Page Up, ↓ or Page Down | The previous or next range |
In resource columns, each resource's days come before the next resource's, and inside a column the week and day keys apply.
Shift+Enter opens the view named day; in the resource timeline it expands or collapses a group
instead. In the week view it needs the
dayView option, and the day view has nothing to open.
Enter on an event clicks its element, so open your own popover or dialog from the element's
onClick. The table shows left-to-right calendars; with direction="rtl" on Root, ← and → swap
so they follow the layout (see Right-to-left).
Changing events
With onEventChange on Root, the registry's month, week, day, resource columns and resource timeline, and a view that binds useCalendarKeyboard,
can change events from the keyboard, just as a drag does; without it, Space picks nothing up and
is left to the focused element. The year view shows events without
changing them, so Space there opens a day's events. Moving a picked-up event into another
resource's column or row swaps that resource, as dropping it there would.
| Focus | Key | Effect |
|---|---|---|
| An event | Space | Pick it up to move it |
| An event | Shift+Space | Pick it up to resize its end. Shift+Space again switches to its start, and back |
| A day (month cell or all-day cell) | Space | Start an all-day event there |
| A slot | Space | Start an hour-long event there |
| Picked up | Arrow keys | Move, resize, or extend it: by days in the month and the all-day row, by slots in the time grid. Moving a timed event above the first slot makes it all-day, and below the all-day row makes it timed |
| Picked up | Enter or Space | Save it through onEventChange |
| Picked up | Escape, Tab, or leaving the view | Cancel. Focus returns to where you started |
A saved change goes through your policies and shows as pending like any other. Read-only events say so when you pick them up, and stay where they are. An agenda has no cells to move events to, so it only navigates and opens them.
useCalendarKeyboard({ snap, createDuration }) sets the slot length (the pointer's snap, 15
minutes by default) and how long a slot create starts out (one hour).
Announcements
Keyboard and pointer moves, resizes, and creates are announced through a polite live region. Render
<Calendar.Announcer messages={announcements} /> once inside Root, with your messages. The
packages ship no text. The registry's calendar item adds a full English set, calendarAnnouncements,
in components/calendar/announcements.ts, and this is a short one of your own:
import type {
CalendarAnnouncementMessages,
CalendarHistoryAnnouncementBuilder,
CalendarHistoryMessages,
CalendarInteractionCause,
CalendarInteractionUpdate,
} from "@moltenship/calendar-solid";
// An English set. Edit the wording, or translate it: the packages ship no text.
const hints: Readonly<Record<CalendarInteractionCause, string>> = {
create: "Use the arrow keys to extend it, then Enter to finish or Escape to cancel.",
move: "Use the arrow keys to move it, then Enter to drop it or Escape to cancel.",
"resize-end": "Use the arrow keys to change its end, then Enter to finish or Escape to cancel.",
"resize-start":
"Use the arrow keys to change its start, then Enter to finish or Escape to cancel.",
};
const name = (update: CalendarInteractionUpdate) => update.event?.title ?? "the new event";
/** What the keyboard and pointer say as a move, resize or create goes. */
export const announcements: CalendarAnnouncementMessages = {
start: (update, { formatRange }) => {
const when = update.proposed === null ? "" : `, ${formatRange(update.proposed)}`;
const opening =
update.cause === "create"
? `New event${when}.`
: update.cause === "move"
? `Picked up ${name(update)}${when}.`
: `Resizing ${name(update)}${when}.`;
return update.input === "keyboard" ? `${opening} ${hints[update.cause]}` : opening;
},
step: (update, { formatRange }) => {
if (update.proposed === null) return null;
const refused = update.check?.status === "rejected" ? ", which can't be saved" : "";
return `${formatRange(update.proposed)}${refused}`;
},
commit: (update, { formatRange }) =>
update.cause === "create"
? `New event for ${formatRange(update.proposed)}.`
: `${update.event?.title ?? "The event"} now runs ${formatRange(update.proposed)}.`,
reject: (update) =>
update.reason === "superseded"
? null
: update.reason === "locked-event"
? `${update.event?.title ?? "The event"} is locked, so it's back where it was.`
: `Couldn't save ${name(update)}, so it's back where it was.`,
cancel: (update) => `Cancelled. ${update.event?.title ?? "Nothing"} stays where it was.`,
};The example at the top of this page shows the announcer instead of hiding it: a style goes over
the announcer's own.
import type { JSX } from "@solidjs/web";
import { createSignal } from "solid-js";
import { calendarAnnouncements } from "@/components/calendar/announcements";
import { applyChange, seed } from "./month-events";
import { Calendar } from "./month-page";
// The announcer hides itself from view. These put it back, to show what a screen reader hears.
const shown: JSX.CSSProperties = {
"clip-path": "none",
height: "auto",
margin: "0",
position: "static",
"white-space": "normal",
width: "auto",
};
/** What the calendar says, under it. Inside `Calendar.Root`. */
export function Spoken() {
return (
<div class="flex min-h-11 shrink-0 items-center gap-3 border-t px-4 py-2 text-sm">
<span class="shrink-0 text-xs font-medium text-muted-foreground uppercase">
Screen reader
</span>
<Calendar.Announcer messages={calendarAnnouncements} style={shown} />
</div>
);
}
export default function SpokenPage() {
const [events, setEvents] = createSignal(seed);
return (
<Calendar.Root
defaultAnchorDate={Temporal.PlainDate.from("2026-10-08")}
defaultTimeZone="UTC"
defaultView="month"
events={events()}
locale="en-US"
onEventChange={(change) => {
setEvents((current) => applyChange(current, change));
}}
weekRules={{ firstDay: 7, minimalDays: 1, weekend: [6, 7] }}
>
<Calendar.Frame class="flex h-dvh flex-col">
<Calendar.Viewport class="min-h-0 flex-1">
<Calendar.ActiveView />
</Calendar.Viewport>
<Spoken />
</Calendar.Frame>
</Calendar.Root>
);
}Announcer renders a visually hidden <div role="status" aria-live="polite">. Without it nothing
is announced. Picking up Standup and moving it down a slot, for example, reads:
- "Picked up Standup, 9:30 – 9:45 AM. Use the arrow keys to move it, then Enter to drop it or Escape to cancel."
- "9:45 – 10:00 AM"
- "Standup now runs 9:45 – 10:00 AM." once
onEventChangehas saved it.
In a calendar with resources, a builder names the resources an event books with the context's
resourceTitle(resourceId).
Customize and localize them
The messages are a CalendarAnnouncementMessages object of your own, with one builder per phase.
Edit the set above in place, or translate it:
| Phase | When | The update also has |
|---|---|---|
start | An event is picked up, or a create starts | check: what the policies say about proposed, or null with no answer yet (a keyboard move or resize that hasn't stepped, or an async policy) |
step | Each arrow key, or each new slot under the pointer | check, as for start |
commit | Your handler saved the change | proposed: the change as saved, and warnings |
reject | A policy or your handler refused it, or the event is read-only | reason, such as "read-only", and error: what your handler or a policy threw, if one did (an AbortError from your handler means the app cancelled) |
cancel | Escape, Tab, leaving the view, or a drag dropped outside it |
Each builder receives the update and a context, and returns the text to speak or null to stay
silent. The update has cause ("move", "resize-start", "resize-end", or "create"),
input ("keyboard" or "pointer"), event (null while creating), and the original and
proposed placements. The context has locale, timeZone, resourceTitle(resourceId), and
formatRange(placement), which formats a placement as the drag preview labels it ("9:30 – 10:00 AM").
formatRange follows the calendar's locale. To change how ranges read, add an optional
formatRange(placement, { locale, timeZone }) to your messages; the default is
formatPlacementRange. It labels the drag preview and becomes the context's formatRange, so it
changes spoken ranges only in builders that call that helper, as the set above does.
Pointer gestures
Pass the root's announcer to the pointer layer, so drags are announced by the same messages and
the drag preview labels ranges with the same formatRange: useCalendarAnnouncer() returns it,
and useCalendarPointer takes it as announcer. The month grid
below does this.
Event names
Render every event as a <button> and name it in full: "Standup, Thursday, October 8, 9:30 – 9:45
AM, saving". Lead with the title, so speech input matches it, then say when, which resource, and
whether a change is still saving. An event with isPending gets aria-busy. Mark today's cell
with aria-current="date".
Right-to-left
Right-to-left takes two settings: dir="rtl" on an ancestor of the calendar, such as <html>,
for the layout, and direction="rtl" on Root for the keys. Root doesn't read the page's
dir, so set both.
← and → then follow the layout, so ← moves to the next day, which an RTL grid shows on the left,
and a picked-up event moves the same way. A view's environment.direction has the value. Write a
view's CSS with logical properties, such as margin-inline-start and inset-inline-start, and it
mirrors with the page.
In your own views
A custom view gets keyboard navigation from three pieces:
getSpatialNavigationon the view's strategy says where each key moves focus. ReusemonthSpatialNavigation,yearSpatialNavigation,timeGridSpatialNavigation,listSpatialNavigationor another the package exports, or write your own.useCalendarKeyboard(options)returns a ref for the element around the view's cells. It bindskeydownandfocusouton that element.useRovingFocus(target)returns the props for one focusable day ({ kind: "day", date }), slot, or event ({ kind: "event", date, eventId }): itstabindex,onFocusandref. Spread them. The view has one tab stop.
This month grid has all three, and dragging on the same
element: ref={[keyboard, pointer]}.
import {
defineCalendarView,
eventIdAttributes,
getMonthRange,
getMonthTitle,
monthSpatialNavigation,
navigateMonth,
projectMonth,
useCalendarAnnouncer,
useCalendarDraftReporter,
useCalendarKeyboard,
useCalendarPointer,
useRovingFocus,
type CalendarViewRendererProps,
type DayGridSegment,
type MonthDay,
type MonthProjection,
} from "@moltenship/calendar-solid";
import { For } from "solid-js";
import type { Meeting } from "./calendar";
type Month = MonthProjection<Meeting, string, string>;
function Day(props: { readonly day: MonthDay; readonly column: number }) {
// An accessor, so the cell registers again when a new projection hands it a new day.
const roving = useRovingFocus(() => ({ date: props.day.date, kind: "day" }));
return (
<button
{...roving}
type="button"
data-date={props.day.date.toString()}
style={{ "grid-column": `${props.column + 1}` }}
>
{props.day.date.day}
</button>
);
}
function Chip(props: {
readonly date: Temporal.PlainDate;
readonly segment: DayGridSegment<Meeting, string, string>;
}) {
const roving = useRovingFocus(
() => ({ date: props.date, eventId: props.segment.event.id, kind: "event" }),
() => ({ days: props.segment.span }),
);
return (
<button
{...roving}
{...eventIdAttributes(props.segment.event.id)}
type="button"
style={{
"grid-column": `${props.segment.column + 1} / span ${props.segment.span}`,
"grid-row": `${props.segment.lane + 2}`,
}}
>
{props.segment.event.title}
<span data-resize="end" aria-hidden="true" />
</button>
);
}
function MonthGrid(props: CalendarViewRendererProps<Month, undefined>) {
const keyboard = useCalendarKeyboard();
// A drag speaks through the root's Announcer, and its draft shows in useCalendarDraft.
const announcer = useCalendarAnnouncer();
const onPreview = useCalendarDraftReporter();
const pointer = useCalendarPointer(() => ({
announcer,
check: props.actions.checkEventChange,
disabled: props.isReadOnly,
events: props.events,
onPreview,
onPropose: props.actions.proposeEventChange,
timeZone: props.environment.timeZone,
}));
return (
<div ref={[keyboard, pointer]}>
<For each={props.projection.weeks} keyed={(week) => week.range.start.toString()}>
{(week) => (
<div style={{ display: "grid", "grid-template-columns": "repeat(7, 1fr)" }}>
<For each={week().days} keyed={(day) => day.date.toString()}>
{(day, index) => <Day day={day()} column={index()} />}
</For>
{/* Keyed by event: a dropped chip keeps its element, and its focus. */}
<For each={week().segments} keyed={(segment) => segment.event.id}>
{(segment) => <Chip date={week().days[segment().column]!.date} segment={segment()} />}
</For>
</div>
)}
</For>
</div>
);
}
export const monthView = defineCalendarView({
name: "month",
strategy: {
getRange: (anchor, environment) => getMonthRange(anchor, environment),
getSpatialNavigation: monthSpatialNavigation,
getTitle: (range, environment) => getMonthTitle(range, environment),
navigate: (anchor, delta) => navigateMonth(anchor, delta),
project: (input) => projectMonth(input) as Month,
},
Renderer: MonthGrid,
});A view shows once the calendar has it. Add monthView to the views that createCalendar takes,
as Registering views does. It takes the name month, which the registry's
month has too, so an app registers one or the other.
Two things to know when you write the elements:
- A key handler inside the view runs after the calendar's. Solid delegates
onKeyDownto the document, and the keyboard listens on the view's element, which the key reaches first. An element that takes a key for itself, such as a chip that opens a popover on Space, listens natively from a ref and callspreventDefault(). The calendar then leaves the key alone. - Render a roving element for as long as its component lives. Solid doesn't call a ref when the
element goes away, so the element stays registered until the component that called
useRovingFocusis disposed. To hide a cell, putShowaround that component, not inside it.
useCalendarInteraction() returns an accessor of the keyboard gesture in progress, for drawing a
create's draft or tinting the cells it covers.