Skip to content
nexubDesign System
v11.9.0

Components · Data Display

Resource Timeline

AlphaAdded v11.4.0

One row per person, days across: rosters, team leave and allocation, with totals in the footer.

import { ResourceTimeline } from '@nexub/react';
View as Markdown

Usage

Use it for
  • Who is where, day by day: rosters, leave, shifts, allocation.

  • A few weeks across and up to a few dozen people.

Use something else for
  • Events at times of day: use EventCalendar.

  • Rows with many fields that sort and filter: use DataTable.

Playground

Props

NameMonday, November 2Tuesday, November 3Wednesday, November 4Thursday, November 5Friday, November 6Saturday, November 7Sunday, November 8Monday, November 9Tuesday, November 10Wednesday, November 11Thursday, November 12Friday, November 13Saturday, November 14Sunday, November 15Total
Ana LimaDesignALAL2
Ben OdeEngineeringSick1
Cho ParkSupport0
Total1113
TSX
<ResourceTimeline resources={people} range={range} now={new Date(2026, 10, 9)} getCell={…} onCellActivate={…} footer={…} rowTotal={…} grandTotal={Object.keys(cells).length} label="Team leave, November 2026" />

Examples

Team leave

Enter or a click on a cell toggles leave; your app opens its own editor there.

NameMonday, November 2Tuesday, November 3Wednesday, November 4Thursday, November 5Friday, November 6Saturday, November 7Sunday, November 8Monday, November 9Tuesday, November 10Wednesday, November 11Thursday, November 12Friday, November 13Saturday, November 14Sunday, November 15Total
Ana LimaDesignALAL2
Ben OdeEngineeringSick1
Cho ParkSupport0
Total1113

Read-only roster

Without `onCellActivate` it is a plain table, and the scroller takes focus so the days can be scrolled.

AgentMonday, November 9Tuesday, November 10Wednesday, November 11Thursday, November 12Friday, November 13Saturday, November 14Sunday, November 15
Ana LimaEarlyEarly
Ben OdeLateLateOn call

Props

Props
PropTypeDefaultDescription
labelrequiredstring—Names the table, e.g. "Team leave, November".
resourcesrequiredTimelineResource[]—{ id, label, description?, avatar? }, one row each. The first column stays put while the days scroll.
rangerequired{ from: Date; to: Date; }—The days shown, both ends included.
getCell((resourceId: string, date: Date) => ResourceCell)—A cell’s content. tone (neutral, primary, success, warning, error, info) colours it; value must say what it means too.
onCellActivate((resourceId: string, date: Date, cell: HTMLElement) => void)—Makes the cells a grid: arrow keys move between them, Enter, Space or a click calls this, e.g. to open your editor anchored to cell.
footer((date: Date) => React.ReactNode)—A totals row: one cell per day.
rowTotal((resourceId: string) => React.ReactNode)—A total column at the end, and its footer cell.
grandTotalReact.ReactNode—A total column at the end, and its footer cell.
resourceHeaderReact.ReactNode—The first column’s header.
weekendnumber[][0, 6]Days of the week shaded as weekend (0 = Sunday).
nowDatenew Date()Marks today. Pin it in tests and screenshots.
classNamestring—

Accessibility

Keyboard

  • Tab

    Enters the grid at the last focused cell (one Tab stop).

  • Arrow keys

    Move between people and days (left and right follow the reading direction).

  • Home / End

    First or last day in the row; with Ctrl, the first or last cell.

  • Enter / Space / F2

    Calls `onCellActivate` for the cell.

Notes

  • A real table: column headers read the full date, row headers the person, so each cell is announced with both.

  • With `onCellActivate` the table has `role="grid"` and roving focus; without it, a plain table in a focusable scroll region.

  • Today’s header has `aria-current="date"` and a filled day number; weekends are shaded and still read their weekday.

On iOS & Android