ProSchedulerSign in

Timeline · Use cases

Work order scheduler

Technicians and their repair orders, coloured by priority, with the customer inside each bar.

Live demo

Hand an urgent job to someone else · Extend a job by an hour

Fullscreen
import { ProScheduler } from "@andreisaac/pro-scheduler"
import { technicians, workOrders, type WorkOrder } from "./data/operations"
import { useEvents } from "./kit"

export function WorkOrderDemo() {
  const { events, handlers } = useEvents(workOrders)

  return (
    <ProScheduler
      data={events}
      resources={technicians}
      view={{ timeline: { type: "week", resolutionHorizontal: "hour", dragTimeStep: 30 } }}
      styleConfig={{ unitWidthPx: 26, fitToWidth: false, laneHeight: 44, resourceColWidth: 190 }}
      renderResource={(tech) => (
        <div className="min-w-0">
          <div className="truncate text-sm font-medium">{tech.name}</div>
          <div className="truncate text-xs text-muted-foreground">{String(tech.skill)}</div>
        </div>
      )}
      renderEventContent={({ original }) => {
        const order = original as WorkOrder
        return (
          <div className="grid min-w-0 text-[11px] leading-tight">
            <strong className="truncate">
              {order.priority === "Urgent" ? "⚠ " : ""}
              {order.title}
            </strong>
            <span className="truncate opacity-85">{order.customer}</span>
          </div>
        )
      }}
      height={500}
      {...handlers}
    />
  )
}

About this demo

Technicians and their repair orders, coloured by priority, with the customer inside each bar.

Things to try

  • Hand an urgent job to someone else
  • Extend a job by an hour

The props behind it are explained in Custom rendering.

Use ProScheduler in your project