Ask Rift AI
Theme: Smoke
Layout: Contained
Background: Field
Search or ask anythingAsk Rift AI
Theme: Smoke
Layout: Contained
Background: Field
Colour mode: System

Resource timeline

Hours within one day

Resource timeline gives each person, room or machine a row and draws a bar from each start to its end on an axis of hours, written the reader’s way. Every bar is named with its row and its times, and its label sits on the calendar’s event fill, so it reads in every theme whatever its accent.

Bookings

  • Room A
    Room A, Workshop, 8:00 AM – 12:00 PMRoom A, Training, 1:00 – 5:30 PM
  • Room B
    Room B, Stand-up, 9:30 – 10:30 AM
  • Studio
    Studio, Recording, 10:00 AM – 6:00 PM

Alternatives

  • Use Gantt chart instead when the bars run over days and months rather than hours within one day.

Props

Read from the same JSDoc that ships in the package's types. A required prop is marked with an asterisk.

ResourceTimeline props
PropTypeDefaultDescription
rows*
ResourceTimelineRow[]
The rows, top to bottom.
startHour
number
6
The first hour the axis shows, 0 to 23. Defaults to 6.
endHour
number
22
The hour the axis ends at, 1 to 24. Defaults to 22.
now
string
A line at this time (`HH:MM`), such as the time now.
label*
string
The timeline's name, read before its rows ("Bookings, Tuesday 4 March").
rowHeaderLabel
string
'Name'
The header of the label column. Defaults to "Name".
onBarClick
((bar: ResourceTimelineBar, row: ResourceTimelineRow) => void)
Called with the bar and its row when a bar is pressed; bars are buttons only when it is set.
locale
string
'en-US'
The BCP 47 locale the times are written in, such as `de-DE`. Defaults to `en-US`. This component can render from a Server Component, so it takes the prop alone and reads no LocaleProvider.
className
string
''
Additional CSS classes

Keys

Nothing here takes focus, so there are no keys. A test holds that.

tsx
// From the npm package
import { ResourceTimeline } from 'rift-ds/components/ResourceTimeline/ResourceTimeline';

// Or as source you own, via the shadcn CLI
npx shadcn@latest add https://rift-ds.com/r/resource-timeline.json

1.6 kB gzipped, with everything it imports. Peer dependencies are not counted.

For agents: the props, their allowed values and defaults, and the tested keys, as markdown or as a JSON schema.