Loading component…
Loading component…
An agent's plan against what really happens – every step's bar grows over its dashed planned ghost, overruns turn amber, and the expected finish moves away from the planned one
To reuse this local React demo, copy all files from the Code tab into the same folder, then import PlanvsActual from ./plan-vs-actual.
import { PlanVsActual, type PlanStep } from "@/components/ui/plan-vs-actual-clean";
const steps: PlanStep[] = [
{ id: "brief", title: "Read the brief", plan: 20000, start: 0, end: 16000 },
{ id: "layout", title: "Build the layout", plan: 60000, deps: ["brief"], start: 17000 },
{ id: "stripe", title: "Wire up Stripe", plan: 45000, deps: ["layout"] },
];
export function Progress({ now }: { now: number }) {
return <PlanVsActual steps={steps} now={now} task="Ship the pricing page" />;
}| Name | Type | Default | Description |
|---|---|---|---|
| steps | PlanStep[] | { id, title, plan, deps?, start?, end?, icon? } – list a step after the steps it waits for | |
| plan | number | Per step – how long it was planned to take, in ms; the planned start follows from deps | |
| deps | string[] | Per step – ids of the steps that have to finish first | |
| start / end | number | Per step – when it really started and finished, in ms from the start of the run; leave end out while it runs, both while it waits | |
| now | number | Where the run is, in ms from its start – running bars grow to it, waiting steps can't start before it | |
| task | string | What the run is for – next to the heading | |
| formatTime | (ms: number) => string | 0:42 | Formats the axis, the bars' numbers and the finish lines |
| title | string | "Plan vs actual" | Heading of the bar on top |
| className | string | Extra class on the root |
Rows keep their height, so nothing jumps while steps start and finish
Under 560px the name column narrows, the task, icons and key drop out and every other axis label hides
Dark mode built in: switches when an ancestor (usually <html>) has the class dark or data-theme="dark"