Resource Timeline
A day-based scheduler with one row per resource. Plan work by moving and resizing bars, reassign it by dropping it on another row, and show a load row under each resource.
Basic Usage
Pass resources, events and the date range. Overlapping events are placed in separate lanes.
Read-only timeline
Overlapping bars of a row are placed in separate lanes.
import { ResourceTimeline } from 'fluxo-ui';
<ResourceTimeline
resources={[{ id: 'alice', name: 'Alice Martin' }, { id: 'bob', name: 'Bob Chen' }]}
events={[
{ id: 'e1', resourceId: 'alice', start: '2025-03-03', end: '2025-03-07', title: 'Checkout page' },
{ id: 'e2', resourceId: 'alice', start: '2025-03-06', end: '2025-03-11', title: 'Design review fixes' },
]}
startDate="2025-03-01"
endDate="2025-03-31"
readOnly
/>Plan and Reassign
Handle onEventChange to move, resize and reassign bars, onExternalDrop to accept new work, and use dayCellTemplate for a per-day row.
Plan and reassign
Move, resize, reassign, drop new work and show a load row under each person.
const [events, setEvents] = useState(initialEvents);
<ResourceTimeline
resources={resources}
events={events}
startDate={start}
endDate={end}
isNonWorkingDay={(date, resourceId) => date.getDay() === 0 || date.getDay() === 6 || isLeave(date, resourceId)}
dayCellTemplate={(resource, date) => <LoadCell resource={resource} date={date} />}
onEventChange={({ item, start, end, resourceId }) =>
setEvents((list) => list.map((e) => (e.id === item.id ? { ...e, start, end, resourceId } : e)))
}
onExternalDrop={({ resourceId, date, dataTransfer }) => addTask(dataTransfer.getData('text/plain'), resourceId, date)}
/>Import
import { ResourceTimeline } from 'fluxo-ui';
import type {
ResourceTimelineProps,
ResourceTimelineResource,
ResourceTimelineEvent,
ResourceTimelineMarker,
ResourceTimelineEventChangeEvent,
ResourceTimelineEventClickEvent,
ResourceTimelineDropEvent,
} from 'fluxo-ui';ResourceTimeline Props
resourcesreqResourceTimelineResource[]Rows of the timeline, for example people or rooms
resourcesreqResourceTimelineResource[]Rows of the timeline, for example people or rooms
eventsreqResourceTimelineEvent[]Bars placed on the rows by resourceId, start and end. Overlapping bars of a row are placed in separate lanes
eventsreqResourceTimelineEvent[]Bars placed on the rows by resourceId, start and end. Overlapping bars of a row are placed in separate lanes
startDatereqDate | stringFirst day shown on the timeline
startDatereqDate | stringFirst day shown on the timeline
endDatereqDate | stringLast day shown on the timeline
endDatereqDate | stringLast day shown on the timeline
dayWidthnumber"32"Width of one day in pixels
dayWidthnumber"32"Width of one day in pixels
laneHeightnumber"28"Height of one lane of bars in pixels
laneHeightnumber"28"Height of one lane of bars in pixels
resourceWidthnumber | string"200"Width of the sticky resource column
resourceWidthnumber | string"200"Width of the sticky resource column
heightnumber | string"480"Height of the component. The body scrolls inside it
heightnumber | string"480"Height of the component. The body scrolls inside it
markersResourceTimelineMarker[]"[]"Vertical dashed lines on given dates, for example milestones
markersResourceTimelineMarker[]"[]"Vertical dashed lines on given dates, for example milestones
readOnlyboolean"false"Disables moving, resizing and dropping
readOnlyboolean"false"Disables moving, resizing and dropping
allowResourceChangeboolean"true"Allows dragging a bar to another row (and moving it with the up / down arrow keys)
allowResourceChangeboolean"true"Allows dragging a bar to another row (and moving it with the up / down arrow keys)
showTodayboolean"true"Highlights today in the header and draws a line on every row
showTodayboolean"true"Highlights today in the header and draws a line on every row
isNonWorkingDay(date: Date, resourceId: string) => booleanShades the days a resource does not work, per row
isNonWorkingDay(date: Date, resourceId: string) => booleanShades the days a resource does not work, per row
resourceTemplate(resource) => ReactNodeCustom content of the resource column
resourceTemplate(resource) => ReactNodeCustom content of the resource column
eventTemplate(item, width) => ReactNodeCustom content of a bar
eventTemplate(item, width) => ReactNodeCustom content of a bar
dayCellTemplate(resource, date) => ReactNodeRenders a row of day cells under the bars of each resource, for example the daily load
dayCellTemplate(resource, date) => ReactNodeRenders a row of day cells under the bars of each resource, for example the daily load
dayCellHeightnumber"24"Height of the day cell row
dayCellHeightnumber"24"Height of the day cell row
emptyMessageReactNode"'No resources'"Shown when there are no resources
emptyMessageReactNode"'No resources'"Shown when there are no resources
classNamestringAdditional CSS class of the root element
classNamestringAdditional CSS class of the root element
ariaLabelstring"'Resource timeline'"Accessible name of the grid
ariaLabelstring"'Resource timeline'"Accessible name of the grid
onEventChange(event: ResourceTimelineEventChangeEvent) => voidCalled after a bar is moved, resized or moved to another row, with the new start, end and resource
onEventChange(event: ResourceTimelineEventChangeEvent) => voidCalled after a bar is moved, resized or moved to another row, with the new start, end and resource
onEventClick(event: ResourceTimelineEventClickEvent) => voidCalled when a bar is clicked without being dragged
onEventClick(event: ResourceTimelineEventClickEvent) => voidCalled when a bar is clicked without being dragged
onEventDoubleClick(event: ResourceTimelineEventClickEvent) => voidCalled on double click or Enter on a bar
onEventDoubleClick(event: ResourceTimelineEventClickEvent) => voidCalled on double click or Enter on a bar
onExternalDrop(event: ResourceTimelineDropEvent) => voidEnables dropping items dragged with the HTML drag and drop API onto a row. Receives the row, the day and the dataTransfer
onExternalDrop(event: ResourceTimelineDropEvent) => voidEnables dropping items dragged with the HTML drag and drop API onto a row. Receives the row, the day and the dataTransfer
ResourceTimelineEvent Properties
idreqstringUnique id of the bar
idreqstringUnique id of the bar
resourceIdreqstringRow the bar belongs to
resourceIdreqstringRow the bar belongs to
startreqDate | stringFirst day of the bar
startreqDate | stringFirst day of the bar
endreqDate | stringLast day of the bar (inclusive)
endreqDate | stringLast day of the bar (inclusive)
titlereqstringLabel and tooltip of the bar
titlereqstringLabel and tooltip of the bar
colorstringBackground colour
colorstringBackground colour
textColorstringText colour
textColorstringText colour
draggableboolean"true"Set to false to prevent moving the bar
draggableboolean"true"Set to false to prevent moving the bar
resizableboolean"true"Set to false to prevent resizing the bar
resizableboolean"true"Set to false to prevent resizing the bar
dataRecord<string, unknown>Any data used by the templates
dataRecord<string, unknown>Any data used by the templates
Features
Rows and Lanes
One row per resource. Bars that overlap in time are stacked in lanes so none is hidden.
Move, Resize, Reassign
Drag bars along time, resize either end, or drop them on another row to change the resource.
External Drop
Accepts items dragged from outside, such as an unscheduled list, onto a row and day.
Day Cells
Optional row of day cells under each resource, for load, availability or totals.
Keyboard Operable
Arrow keys move bars, Alt and Ctrl with arrows resize them, up and down arrows change the row.