ProSchedulerSign in

Timeline · Resources

Resource grouping and hierarchy

Resources with children become collapsible groups; eventCreation: false keeps the department rows free of bookings.

Live demo

Collapse Post-production · Drag work between departments

Fullscreen
import { useState } from "react"
import { ProScheduler } from "@andreisaac/pro-scheduler"
import { studioAssignments, studioTeams } from "./data/studio"
import { useEvents } from "./kit"

export function HierarchyDemo() {
  const { events, handlers } = useEvents(studioAssignments)
  const [log, setLog] = useState("Collapse a department with its chevron.")

  return (
    <div className="docs-demo__stack">
      <p className="demo-status">{log}</p>
      <ProScheduler
        data={events}
        // Departments with people inside; department rows take no bookings.
        resources={studioTeams.map((team) => ({ ...team, eventCreation: false }))}
        view={{ timeline: { type: "month" } }}
        onResourceCollapse={(team, collapsed) => setLog(`${team.name} ${collapsed ? "collapsed" : "expanded"}`)}
        height={560}
        {...handlers}
      />
    </div>
  )
}

About this demo

Resources with children become collapsible groups; eventCreation: false keeps the department rows free of bookings.

Things to try

  • Collapse Post-production
  • Drag work between departments

The props behind it are explained in Resources.

Use ProScheduler in your project