ProSchedulerSign in

Timeline · Use cases

Task progress tracking

A progress bar in every bar, driven by a field on the event. Clicking logs progress through onEventClick.

Live demo

Click a job a few times

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

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

  return (
    <div className="docs-demo__stack">
      <p className="demo-muted">Click a job to log 20% more progress.</p>
      <ProScheduler
        data={events}
        resources={technicians}
        view={{ timeline: { type: "week", resolutionHorizontal: "hour" } }}
        styleConfig={{ unitWidthPx: 26, fitToWidth: false, laneHeight: 40 }}
        showDefaultEditor={false}
        onEventClick={(event) =>
          setEvents((list) =>
            list.map((o) => (o.id === event.id ? { ...o, progress: Math.min(100, o.progress + 20) } : o))
          )
        }
        renderEventContent={({ original }) => {
          const order = original as WorkOrder
          return (
            <div className="grid w-full min-w-0 gap-1">
              <span className="truncate text-[11px]">
                {order.title} · {order.progress}%
              </span>
              <span className="h-1.5 w-full overflow-hidden rounded-full bg-white/30">
                <span className="block h-full bg-white" style={{ width: `${order.progress}%` }} />
              </span>
            </div>
          )
        }}
        height={480}
        {...handlers}
      />
    </div>
  )
}

About this demo

A progress bar in every bar, driven by a field on the event. Clicking logs progress through onEventClick.

Things to try

  • Click a job a few times

The props behind it are explained in Custom rendering.

Use ProScheduler in your project