Skip to content
EspañolEnglish
All components (283)

Resource timeline

Dates and time · ResourceTimeline

What it is and when to use it

A schedule by resources: one row per person or room and one bar per booking, over a line of days. Two overlapping bars go in different lanes, so the overlap can be seen.

When to use it

  • Room occupancy, team shifts, workshop machines.
  • resources are the rows and events the bars, with the last day included. start and days say what is shown.
  • onEventPress turns each bar into a button.

When not to

  • An agenda by hours: WeekAgenda.
  • Project milestones in order: Timeline.

Keyboard: Tab reaches the box, which scrolls with the arrows, and each bar if it is a button.

Accessibility: it is a list of resources with the list of their bars, and each bar says its title and its full dates. A bar continuing before what is shown has a dashed edge, and one continuing after has a straight one.

Fine-tuning: --amset-timeline-name is the width of the names, --amset-timeline-day the minimum of a day and --amset-timeline-lane-height the height of a lane.

What it looks like

March occupancy

2 to 15 March · 4 resources

  • Workshop
    • Aurelia order, March 2 – March 6
    • Review, March 5 – March 7
  • Meeting room
    • Training, March 3 – March 4
  • Marta Ruiz
    • Holidays, February 24 – March 4
  • José Ortega
    • Madrid fair, March 4 – March 12

<Card
  title="March occupancy"
  subtitle="2 to 15 March · 4 resources"
  >
  <SegmentedGroup label="Show" size="sm" value={grupo} onChange={setGrupo} options={grupos} />
  <ResourceTimeline
    label="March occupancy"
    resources={[{ key: "r1", label: "Workshop" }, { key: "marta", label: "Marta Ruiz" }]}
    events={[
      { key: "1", resource: "r1", title: "Aurelia order", start: "2026-03-02", end: "2026-03-06" },
      { key: "4", resource: "marta", title: "Holidays", start: "2026-02-24", end: "2026-03-04", tone: "success" },
    ]}
    start="2026-03-02"
    days={14}
  />
</Card>

Props

Import it with import { ResourceTimeline } from '@amset/ui'. Required props are marked.

PropTypeWhat it does
eventsrequiredreadonly TimelineEvent[]The bars: `{ key, resource, title, start, end, tone? }`, with the last day included.
labelrequiredstringWhat is being shown: "Room bookings". Required.
resourcesrequiredreadonly TimelineResource[]The rows: people, rooms, machines.
startrequiredstringThe first day shown, `YYYY-MM-DD`.
classNamestringMerged with the library classes; it does not replace them.
daysnumberHow many days are shown. By default, 14.
errorReactNodeThe data has not arrived: it says so in the place of the drawing, with what is passed here.
loadingbooleanThe data is on its way.
onEventPress(key: string) => voidTurns each bar into a button and hands over its key.

It also accepts the attributes of the element it renders: className, style, data-*, aria-* and its events.

In the test bench

Every state and variant, to try one at a time, on its page at storybook.amsetui.com: