Examples

Team schedule

Tab into the grid and use the arrow keys. Enter on an empty day or time adds an event; Enter on a cell with events moves into them; Alt + arrows move the focused event. Or drag an event.

Preview

March 2031

Sun
Mon
Tue
Wed
Thu
Fri
Sat
Sunday, February 23, 2031.
Monday, February 24, 2031.
Tuesday, February 25, 2031.
Wednesday, February 26, 2031.
Thursday, February 27, 2031.
Friday, February 28, 2031.
Saturday, March 1, 2031.
Sunday, March 2, 2031.
Monday, March 3, 2031.
Tuesday, March 4, 2031.
Wednesday, March 5, 2031.
Thursday, March 6, 2031.
Friday, March 7, 2031.
Saturday, March 8, 2031.
Sunday, March 9, 2031.
Monday, March 10, 2031.
Tuesday, March 11, 2031, 1 event.
Wednesday, March 12, 2031, 4 events.
Thursday, March 13, 2031, 1 event.
Friday, March 14, 2031, 1 event.
Saturday, March 15, 2031.
Sunday, March 16, 2031.
Monday, March 17, 2031.
Tuesday, March 18, 2031, 1 event.
Wednesday, March 19, 2031, 1 event.
Thursday, March 20, 2031.
Friday, March 21, 2031.
Saturday, March 22, 2031.
Sunday, March 23, 2031.
Monday, March 24, 2031.
Tuesday, March 25, 2031.
Wednesday, March 26, 2031.
Thursday, March 27, 2031.
Friday, March 28, 2031.
Saturday, March 29, 2031.
Sunday, March 30, 2031.
Monday, March 31, 2031.
Tuesday, April 1, 2031.
Wednesday, April 2, 2031.
Thursday, April 3, 2031.
Friday, April 4, 2031.
Saturday, April 5, 2031.
Arrow keys move between days and times. Enter adds an event, or opens the events in a cell. Escape returns to the cell.Alt plus arrow keys move the event; Alt plus Shift plus arrow keys change its end.
Example.tsx
import { EventCalendar, type CalendarEvent } from '@reactloom/scheduler';
import { useState } from 'react';

// Fixed dates keep the prerendered page and the live example identical.
const at = (day: number, hour: number, minute = 0) => new Date(Date.UTC(2031, 2, day, hour, minute));

const initial: CalendarEvent[] = [
  { id: 'standup', title: 'Team stand-up', start: at(12, 9), end: at(12, 9, 15) },
  { id: 'review', title: 'Quarterly business review', start: at(11, 13), end: at(11, 15) },
  { id: 'design', title: 'Design critique', start: at(12, 10), end: at(12, 11, 30) },
  { id: 'interview', title: 'Interview: frontend engineer', start: at(12, 10, 30), end: at(12, 11, 30) },
  { id: 'billing', title: 'Billing run', start: at(12, 0), end: at(13, 0), allDay: true },
  { id: 'lunch', title: 'Customer lunch', start: at(13, 12), end: at(13, 13, 30) },
  { id: 'offsite', title: 'Engineering offsite', start: at(18, 0), end: at(20, 0), allDay: true },
  { id: 'release', title: 'Release 2.4', start: at(14, 16), end: at(14, 17) },
];

export default function Example() {
  const [events, setEvents] = useState(initial);
  return (
    <div style={{ width: '100%' }}>
      <EventCalendar
        aria-label="Team calendar"
        events={events}
        defaultDate={at(12, 9)}
        timeZone="UTC"
        height={460}
        // Your app would open a form here; the demo adds a placeholder event.
        onCreate={({ start, end, allDay }) => setEvents((list) => [...list, { id: `new-${list.length}`, title: 'New event', start, end, allDay }])}
        onEventChange={({ event, start, end }) => setEvents((list) => list.map((e) => (e.id === event.id ? { ...e, start, end } : e)))}
      />
    </div>
  );
}

Rooms: timeline, resources and repeating events

A row per room in the timeline and a column per room in the day view. Alt + ↑ / ↓ in the timeline (or ← / → in the day view) move a booking to another room; Alt + Shift + arrows change its end; drag the edge of an event to resize it.

Preview

Mar 9 – 15, 2031

Room bookings
Sun9
Mon10
Tue11
Wed12
Thu13
Fri14
Sat15
Room A
Room A, Sunday, March 9, 2031.
Room A, Monday, March 10, 2031, 1 event.
Room A, Tuesday, March 11, 2031, 1 event.
Room A, Wednesday, March 12, 2031, 1 event.
Room A, Thursday, March 13, 2031, 1 event.
Room A, Friday, March 14, 2031, 1 event.
Room A, Saturday, March 15, 2031.
Room B
Room B, Sunday, March 9, 2031.
Room B, Monday, March 10, 2031.
Room B, Tuesday, March 11, 2031, 1 event.
Room B, Wednesday, March 12, 2031, 2 events.
Room B, Thursday, March 13, 2031, 1 event.
Room B, Friday, March 14, 2031.
Room B, Saturday, March 15, 2031.
Studio
Studio, Sunday, March 9, 2031.
Studio, Monday, March 10, 2031.
Studio, Tuesday, March 11, 2031.
Studio, Wednesday, March 12, 2031, 1 event.
Studio, Thursday, March 13, 2031, 1 event.
Studio, Friday, March 14, 2031, 1 event.
Studio, Saturday, March 15, 2031, 1 event.
Arrow keys move between days and times. Enter adds an event, or opens the events in a cell. Escape returns to the cell.Alt plus arrow keys move the event; Alt plus Shift plus arrow keys change its end.
Example.tsx
import { EventCalendar, type CalendarEvent } from '@reactloom/scheduler';
import { useState } from 'react';

const at = (day: number, hour: number, minute = 0) => new Date(Date.UTC(2031, 2, day, hour, minute));

const rooms = [
  { id: 'a', title: 'Room A' },
  { id: 'b', title: 'Room B' },
  { id: 'studio', title: 'Studio' },
];

const initial: CalendarEvent[] = [
  // Repeats every weekday (an RRULE can be read with parseRRule('FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR')).
  { id: 'standup', title: 'Stand-up', start: at(10, 9), end: at(10, 9, 15), resourceId: 'a', recurrence: { frequency: 'weekly', weekdays: ['MO', 'TU', 'WE', 'TH', 'FR'] } },
  { id: 'workshop', title: 'Design workshop', start: at(12, 10), end: at(12, 12), resourceId: 'b' },
  { id: 'podcast', title: 'Podcast recording', start: at(12, 13), end: at(12, 15), resourceId: 'studio' },
  { id: 'training', title: 'Onboarding training', start: at(11, 0), end: at(14, 0), allDay: true, resourceId: 'b' },
  { id: 'shoot', title: 'Product shoot', start: at(13, 9), end: at(15, 18), resourceId: 'studio' },
];

// Day view has a column per room; timeline a row per room. Alt + arrows move between rooms or
// days; Alt + Shift + arrows change the end. A moved occurrence reports its occurrenceStart.
export default function Example() {
  const [events, setEvents] = useState(initial);
  return (
    <div style={{ width: '100%' }}>
      <EventCalendar
        aria-label="Room bookings"
        events={events}
        resources={rooms}
        views={['timeline', 'day', 'month']}
        defaultView="timeline"
        defaultDate={at(12, 9)}
        timeZone="UTC"
        height={420}
        onEventChange={({ event, start, end, resourceId, occurrenceStart }) =>
          setEvents((list) =>
            occurrenceStart
              ? // One occurrence of a series: keep the series, add the moved occurrence as its own event.
                [
                  ...list.map((e) => (e.id === event.id && e.recurrence ? { ...e, recurrence: { ...e.recurrence, exceptions: [...(e.recurrence.exceptions ?? []), occurrenceStart] } } : e)),
                  { id: `${event.id}-${occurrenceStart.toISOString()}`, title: event.title, start, end, resourceId },
                ]
              : list.map((e) => (e.id === event.id ? { ...e, start, end, resourceId } : e)),
          )
        }
      />
    </div>
  );
}

Agenda first

A list of days and events: the clearest view for long ranges and for screen-reader users.

Preview

Mar 10 – 19, 2031

  1. Monday, March 10, 2031

  2. Tuesday, March 11, 2031

  3. Wednesday, March 12, 2031

  4. Monday, March 17, 2031

Arrow keys move between days and times. Enter adds an event, or opens the events in a cell. Escape returns to the cell.Alt plus arrow keys move the event; Alt plus Shift plus arrow keys change its end.
Example.tsx
import { EventCalendar, type CalendarEvent } from '@reactloom/scheduler';

const at = (day: number, hour: number, minute = 0) => new Date(Date.UTC(2031, 2, day, hour, minute));

const shifts: CalendarEvent[] = [
  { id: 'a', title: 'Support rota: Priya', start: at(10, 8), end: at(10, 16) },
  { id: 'b', title: 'Support rota: Tomás', start: at(11, 8), end: at(11, 16) },
  { id: 'c', title: 'Maintenance window', start: at(12, 22), end: at(12, 23, 30) },
  { id: 'd', title: 'Public holiday', start: at(17, 0), end: at(18, 0), allDay: true },
];

export default function Example() {
  return (
    <div style={{ width: '100%' }}>
      <EventCalendar aria-label="Support rota" events={shifts} defaultView="agenda" views={['agenda', 'week']} defaultDate={at(10, 8)} timeZone="UTC" agendaDays={10} />
    </div>
  );
}

Your data, your rules

The calendar never changes your events. It reports what the person asked for — onCreate with a range, onEventChange with a new start and end — and shows whatever events you pass next. That keeps validation, conflicts, permissions and saving in your app.

Optimistic move with rollback
<EventCalendar
  events={events}
  timeZone={user.timeZone}            // e.g. 'Europe/Berlin'
  onCreate={(range) => openNewEventDialog(range)}
  onEventChange={async ({ event, start, end }) => {
    setEvents((list) => list.map((e) => (e.id === event.id ? { ...e, start, end } : e))); // optimistic
    try {
      await api.moveEvent(event.id, { start, end });
    } catch {
      setEvents((list) => list.map((e) => (e.id === event.id ? event : e))); // roll back
      toast.error('Could not move the event.');
    }
  }}
  onEventSelect={(event) => openEvent(event.id)}
/>

API reference

EventCalendar props
PropTypeDefault
eventsrequired
End is exclusive; all-day events run midnight to midnight in timeZone. recurrence: { frequency, interval?, weekdays?, count?, until?, exceptions? } (parseRRule reads iCalendar rules).
{ id, title, start: Date, end: Date, allDay?, color?, recurrence?, resourceId? }[]—
view / defaultView / onViewChange
'month' | 'week' | 'day' | 'agenda' | 'timeline''month'
resources
A column each in day view and a row each in timeline view.
{ id, title }[]—
timelineDays
Days in timeline view (7 starts on the locale's first day of the week).
number7
views
Views in the switcher.
CalendarView[]—
date / defaultDate / onDateChange
A day in the visible range. Default: today.
Date—
timeZone
IANA time zone for display and calculations. Default: the browser's.
string—
onCreate
Enter on an empty day or slot, or a double-click.
({ start, end, allDay }) => void—
onEventChange
kind 'move' (Alt + arrows, drag) or 'resize' (Alt + Shift + arrows, dragging an edge). For one occurrence of a repeating event, event is the series and occurrenceStart says which one.
({ event, start, end, allDay, kind, resourceId?, occurrenceStart? }) => void—
onEventSelect
Enter, Space or click on an event.
(event) => void—
slotMinutes
Rows in week and day views.
15 | 30 | 6030
dayStartHour · dayEndHour · scrollToHour
number0 · 24 · 8
height
Scroll area of week and day views.
number | string560
agendaDays
number14
headingLevel
The range title's heading.
2 | 3 | 42
renderEvent
Custom event content.
(event) => ReactNode—
messages
Translate every built-in string.
Partial<SchedulerMessages>—

Customization

Events use their color or the theme's chart colours in order; everything else uses ReactLoom tokens.

Extracted from the component’s source on every build, so it matches the code. How the layers fit together is explained in Customization.

State attributes

Target these in your CSS to style states without depending on class names.

AttributeValues
[data-all-day]present when on
[data-axis]present when on
[data-compact]present when on
[data-continues-after]present when on
[data-continues-before]present when on
[data-dragging]present when on
[data-drop-target]present when on
[data-hour]present when on
[data-outside]present when on
[data-recurring]present when on
[data-today]present when on

Theme tokens it reads

--pl-color-accent-fg --pl-color-accent-solid --pl-color-bg-subtle --pl-color-bg-surface --pl-color-border-default --pl-color-border-subtle --pl-color-fg-default --pl-color-fg-muted --pl-color-fg-on-accent --pl-focus-ring-color --pl-focus-ring-width --pl-font-size-lg --pl-font-size-sm --pl-font-size-xs --pl-radius-md --pl-radius-xs

Accessibility

  • Month, week and day views are WAI-ARIA grids with one tab stop. Each cell is named by its date (and time) and how many events it has; each event by its title, time and date.
  • Everything a pointer can do, the keyboard can: adding an event, opening it, and moving it. Moves are announced politely and focus stays on the event, even when it moves to another week.
  • Arrow keys follow the reading direction in right-to-left layouts.
  • Repeating events say “repeats” in their name; multi-day events give their first and last day, and appear in every day they cover so each cell reads completely.
  • Resource cells are named by the resource and the date or time; resizing announces the new end.
  • The agenda view is an ordinary list — offer it for long ranges and as the default for people who prefer lists.
  • Today is highlighted after the page loads, so server and browser render the same markup.
Keyboard interactions
KeyAction
← → ↑ ↓Move between days (month) or days and time slots (week, day)
Home / EndFirst / last day of the week
Page Up / Page DownPrevious / next month (month) or week
Enter (empty cell)Add an event there
Enter or F2 (cell with events)Move into its events; ↑ ↓ between them
Alt + ← / →Move the focused event a day earlier / later
Alt + ↑ / ↓Move it a week (month), a time slot (week, day) or to the next resource (timeline)
Alt + ← / → (day view with resources)Move it to the neighbouring resource
Alt + Shift + ↑ / ↓End a time slot earlier / later (week, day)
Alt + Shift + ← / →End a day earlier / later (month, timeline)
EscapeBack to the cell

Usage guidelines

Do

  • Pass the user's time zone explicitly when your server stores UTC.
  • Confirm moves that affect other people (invitees, bookings) in your onEventChange.

Don’t

  • Don't make dragging the only way to reschedule in your own custom views.