Views

Resource timeline

The Solid resource timeline, rooms or people as rows and time as columns for a day, a week or a month, with hundreds of rows, from the Solid registry.

Live. The page that Add it builds, with two floors of rooms and a person on October 8, 2026. Drag an event to another room.

The Solid demo shows a week of rooms and teams: pick Timeline in the view switcher.

createTimelineDayView, createTimelineWeekView and createTimelineMonthView show one row for each resource, such as a room or a person, with time running across. A day is split into hours, and a week or a month into days. Each resource's events are bars in its row. Resources with children appear as groups that collapse. Only the rows and slots in view render, so the timeline stays fast with hundreds of resources over a whole month.

Add it

Add the resource-timeline-view item to your app with the shadcn CLI, as UI source describes. It brings the theme, the shared calendar parts, the kit's button and @tanstack/virtual-core:

npx shadcn@latest add @moltenship/resource-timeline-view

Then register the views:

calendar.tsx
import {
  createCalendar,
  createCanonicalEventAdapter,
  type CalendarEvent,
  type CalendarEventChange,
  type CalendarResource,
} from "@moltenship/calendar-solid";
import { createSignal } from "solid-js";

import type { CalendarEventColor } from "@/components/calendar/event-colors";
import {
  createTimelineDayView,
  createTimelineMonthView,
  createTimelineWeekView,
} from "@/components/calendar/resource-timeline-view/resource-timeline-view";

export type Meeting = CalendarEvent<{ readonly color: CalendarEventColor }>;
export type Room = CalendarResource<{ readonly kind: "floor" | "room" | "person" }>;

const getEventColor = (meeting: Meeting) => meeting.data.color;

export const Calendar = createCalendar<Meeting, Room>()({
  eventAdapter: createCanonicalEventAdapter<{ readonly color: CalendarEventColor }>(),
  views: [
    createTimelineDayView<Meeting, Room>({
      getEventColor,
      // Rooms stack their bookings; people keep a lane for each level of overlap.
      getResourceOverlapLayout: (resource) => (resource.data.kind === "room" ? "stack" : undefined),
    }),
    createTimelineWeekView<Meeting, Room>({ getEventColor }),
    createTimelineMonthView<Meeting, Room>({ getEventColor }),
  ],
});

The views are named timeline-day, timeline-week and timeline-month. The week starts on weekRules.firstDay, and the month view shows the anchor's calendar month, from the 1st to its last day. Previous and Next move by a day, a week or a month. The timeline scrolls inside the height it's given, so give Calendar.Viewport a height, and save the changes a drag or a key proposes in onEventChange:

timeline-page.tsx
export default function TimelinePage() {
  const [events, setEvents] = createSignal<readonly Meeting[]>(seed);
  // A drag or a key proposes a change; saving it moves the event, to another room too.
  const save = (change: CalendarEventChange<Meeting, string, string>) => {
    if (change.cause === "create") {
      const meeting: Meeting = {
        data: { color: "blue" },
        id: crypto.randomUUID(),
        title: "New meeting",
        ...change.proposed,
      };
      setEvents((all) => [...all, meeting]);
    } 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")}
      defaultExpandedResourceIds={["floor-1", "floor-2"]}
      defaultTimeZone="UTC"
      defaultView="timeline-day"
      events={events()}
      locale="en-US"
      onEventChange={save}
      resources={rooms}
      weekRules={{ firstDay: 1, minimalDays: 4, weekend: [6, 7] }}
    >
      {/* The timeline scrolls inside the height it's given. */}
      <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>
  );
}

Resources

Pass the resources to Root as resources. Each one has an id, a title, and optionally a parentId, which puts it in a group under that resource. Events list the resources they book in resourceIds, read through your event adapter's getResourceIds. An event that books several resources shows in each of their rows.

rooms.ts
export const rooms: readonly Room[] = [
  { data: { kind: "floor" }, id: "floor-1", title: "First floor" },
  { data: { kind: "room" }, id: "orchid", parentId: "floor-1", title: "Orchid" },
  { data: { kind: "room" }, id: "lotus", parentId: "floor-1", title: "Lotus" },
  { data: { kind: "floor" }, id: "floor-2", title: "Second floor" },
  { data: { kind: "room" }, id: "iris", parentId: "floor-2", title: "Iris" },
  { data: { kind: "person" }, id: "ada", title: "Ada" },
];

A group's children show while its ID is in expandedResourceIds. The chevron beside a group's name toggles it. To control expansion yourself, pass expandedResourceIds and onExpandedResourceIdsChange. Groups start collapsed unless you list them in defaultExpandedResourceIds, as the page above does.

A resource can have its own working hours and time zone. The timeline shades the time outside them, and a resource's header shows its local time while its clock differs from the display time zone's. See people and rooms.

Anatomy

ResourceTimelineView 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/resource-timeline-view.

Rendered by ResourceTimelineView
ResourceTimelineView             resource-timeline-view.tsx
└── ResourceTimelineGrid         resource-timeline-grid.tsx, scrolls both ways
    ├── ResourceTimelineHeader   resource-timeline-header.tsx, sticky at the top
    │   ├── Date or month        stays in view while you scroll sideways
    │   └── Hour or day          one per rendered slot
    ├── ResourceTimelineRow      resource-timeline-row.tsx, one per rendered resource
    │   ├── Resource name        sticky at the inline start, with a group's toggle
    │   └── Cell                 one per rendered slot
    │       ├── Day              data-date, in a week or a month
    │       ├── Date strip       data-axis="inline" and data-date, in a day
    │       ├── UnavailableTime  resource-timeline-availability.tsx, the shading of closed time
    │       ├── EventChip        resource-timeline-event.tsx
    │       └── Keyboard cursor  resource-timeline-focus.tsx, on the focused cell
    └── Now line                 data-slot="resource-timeline-now"

The .tsx files are Solid components. What they render comes from plain TypeScript beside them, the same files React's timeline reads:

FileHolds
resource-timeline.styles.tsEvery class the parts set, so a restyle is one file
timeline-labels.tsThe header's dates and hours, the cells' names and the events' times
timeline-scale.tsThe slots of a range, and how they group into dates or months
timeline-placement.tsWhere each bar sits in its row, and how tall a row's lanes or stacks are
timeline-availability.tsThe closed stretches of each resource's row
timeline-focus.tsWhich row and slot the keyboard's focus is on, and what it drafts
timeline-virtualizer.tsWhich rows and slots render, on @tanstack/virtual-core
  • useTimelineVirtualizer in use-timeline-virtualizer.ts binds the virtualizer to Solid: the rows and slots in view, a few beyond, and the focused ones. Slots share the width the resource column leaves until they are 56px for an hour or 48px for a day, then the view scrolls sideways. The resource column is 208px wide, or 128px on narrow screens.
  • The header and the resource column are position: sticky inside the one scrolling element, so they move with it exactly and a row's name stays inside its row for screen readers.
  • timeline-placement.ts puts each bar in the first rendered cell it covers, so a bar that starts off-screen still shows. A row is as tall as its lanes, or its stacks, need, and at least 44px.

Options

Pass them to the view's create… function, or per root in viewOptions, such as viewOptions={{ "timeline-week": { unassigned: "bucket" } }}:

Prop

Type

What it shows

  • Header: the hours under their date, or the days under their month with today highlighted and marked aria-current="date". Weekends are tinted down every row.
  • Rows: each resource's name, indented under its group. Groups are tinted, and their chevron shows or hides their children.
  • Events over days: laid out like a month row. A timed event within one day shows its title and start time, as "Standup 9:30 AM", and drops the time when the day is too narrow. Longer events span their days.
  • Events over hours: each bar spans its exact times on a 24-hour wall clock. Hours skipped when the clocks go forward are hatched, and hours repeated when they go back are tinted.
  • Both: an event that starts before or ends after the range is squared off at that edge. Events that overlap sit in lanes, and the row grows to fit them. Over hours, a row can stack them instead.
  • Closed time, from the root's availability and each resource's own hours, is shaded in its row.
  • Current time: a line through today at the current time, from useNow(). A day opens scrolled to it, or to 08:00 when today isn't shown.
  • Editing: with onEventChange on Root, drag an event along its row to move it, or onto another row to move it to that resource. A move swaps the resource you dragged from for the one you dropped on and keeps the event's other resources. Drag an event's start or end edge to resize it, and drag across empty time to create an event in that resource. Over days these steps are whole days, and an event keeps its time; over hours they're half hours. Escape cancels a drag. See Interactions.
  • Changes being saved: events with a pending change, the ones useCalendarPendingChanges returns, get aria-busy and render at 60% opacity.
  • Accessible names: the grid is named after the range, each row after its resource, and each cell after its resource, time and number of events, as in "Orchid, Monday, October 5, 2026, 2 events". Events end with their resource, as in "Design review, Tuesday, October 6, 10:00 – 11:30 AM, Orchid".
  • On a phone the resource column narrows to 128px, bars are at least 24px tall, and a long press doesn't select their text.
  • Right to left runs time from right to left and keeps the resource column at the start, when the page or Calendar.Frame has dir="rtl".
  • Reduced motion drops the drag preview's glide and the chevron's turn.

A drag changes only the pointer layer's ghosts: the rows and their events don't render again until the change is saved.

Stacked rows

A busy room takes a lane for each level of overlap, so its row grows. In an hour timeline, overlapLayout: "stack" cascades a row's overlapping events instead: each bar sits a third of a lane below the one it covers and is drawn over it, and a deep stack steps less, so the row is never more than two lanes tall. getResourceOverlapLayout picks it per resource, as the page above does for rooms, so Orchid's three bookings stack while Ada keeps her lanes:

calendar.tsx
// Rooms stack their bookings; people keep a lane for each level of overlap.
getResourceOverlapLayout: (resource) => (resource.data.kind === "room" ? "stack" : undefined),
  • "columns" and "equal" are the same here: a lane per level of overlap. A row has no fixed height to share, so no bar narrows.
  • A group's deepest bar sets its step, so a long booking under a busy stretch, such as a desk booked all day, compresses every cascade in it. Hover or focus a covered bar to bring it up.
  • A group of overlapping events takes its events' own layout, from getEventOverlapLayout, when they all agree, and otherwise its row's. A group's layout depends only on its own events. The Unassigned row follows overlapLayout.
  • Bars are drawn in time order, so each covers the ones before it. A covered bar rises while you hover over it or focus it, so its title shows. ← and → walk a row's bars in the same order, and Enter on a cell starts at the bar the others cover, as in lanes.
  • A day timeline lays each row out like a month row, whatever the layout.

Keyboard

Tab into the example, or click a cell, and try these keys. The Accessibility page has the full map and what a screen reader hears.

FocusKeyEffect
A cell← →Previous or next day, or half hour in a day
A cell↑ ↓The same time in the previous or next row
A cellHome, EndThe first or last day or half hour shown
A cellPage Up, Page DownBack or forward a whole day, week or month
A cellEnterThe events covering it in that row. Escape goes back to the event's cell
An event← →Previous or next event in the row
An event↑ ↓The cell at its start in the previous or next row
A group's cellShift+EnterExpand or collapse the group
A daySpaceStart an all-day event there. Arrow keys extend it, and Enter saves it
A half hourSpaceStart an hour-long event there. Arrow keys extend it, and Enter saves it
An eventSpacePick it up. Arrow keys move it along its row and to other rows
An eventShift+SpacePick up its end to resize it. Shift+Space again switches to its start

Enter drops a picked-up event and Escape puts it back. Moving it to another row moves it to that resource, the same change as dropping it there with the pointer, and announcements name the resource: "Moved Design review to Tuesday, October 6, 10:00 – 11:30 AM, Lotus." Focus is a resource and a time, not an element, so it survives scrolling: the focused row and slot keep rendering wherever you scroll, and each key brings its target into view. The grid is one tab stop.

Markup for interactions

The view connects the pointer layer for you. Each resource's row has resourceIdAttributes(id), which sets data-resource-id: a drop or create inside it lands in that resource.

  • Over days: each day cell has an inner element with data-date, beside the events rather than around them, so dragging an event by a later day moves it from that day.
  • Over hours: each row has a data-axis="inline" strip with data-date for every date, and the view passes its projection's columns to the pointer layer, which maps a position along the strip to a wall time.
  • Events: they're buttons with data-event-id, and events you can edit have data-resize="start" and data-resize="end" handles.
  • Sticky parts: the header and each row's name have data-occludes, so the pointer layer doesn't look through them to the cells scrolled beneath.

On this page