Plan
The steps an agent means to take, with the one it is on and how far it got.
NewInstallation
Copy and paste the following code into your project.
Update the import paths to match your project structure.
Anatomy
Show it before the agent starts and keep it in sync while it works. The reader sees what is coming, which step is live and what got skipped, so a long run never feels like a black box.
completed and total draw the count and a thin progress line under the header. Leave them out for a plan that is still being written.Composition
Use the following composition to build a
Plan:Live
Move each step through
pending, active and complete as the agent reports back. Mark a step skipped when the agent decides it is not needed, and error when it failed.- Read the failing test, In progress
- Find where the discount is rounded, Pending
- Round once, after tax, Pending
- Run the checkout suite, Pending
Plan, Task or Queue
- Plan is what the agent intends to do, in order, decided up front.
- Task is one piece of work with its details, like the files it touched.
- Queue holds what the reader or the agent lined up for later.
Accessibility
- The steps are an ordered list. The active one carries
aria-current="step". - Each step ends with its status for screen readers ("Run the checkout suite, In progress"), and the header reads "2 of 4 done" instead of "2/4".
- The header is a button with
aria-expandedthat controls the list.
API Reference
Plan
| Prop | Type | Default | Description |
|---|---|---|---|
defaultOpen | boolean | true | Open state when uncontrolled |
open | boolean | - | Controlled open state |
onOpenChange | (open: boolean) => void | - | Called when the open state changes |
className | string | - | Additional CSS classes |
Plan.Header
| Prop | Type | Default | Description |
|---|---|---|---|
title | ReactNode | - | What the plan is for |
completed | number | - | Steps done |
total | number | - | Steps in the plan |
progressLabel | (completed: number, total: number) => string | "2 of 4 done" | Progress read by screen readers |
className | string | - | Additional CSS classes |
Plan.Step
| Prop | Type | Default | Description |
|---|---|---|---|
status | 'pending' | 'active' | 'complete' | 'skipped' | 'error' | 'pending' | Where the step is |
description | ReactNode | - | One line under the step |
statusLabels | Partial<Record<Status, string>> | - | Screen reader labels for each status |
className | string | - | Additional CSS classes |
Found something to improve?
Notice a bug, typo, or missing detail on this page? Help us make the documentation better by opening a GitHub issue.