Skip to content

Agent Plan

The steps an agent intends to take, checked off live: numbered steps with sub-steps, elapsed times and a progress bar. When the plan changes, new steps fade in, removed ones fade out, moved ones slide and replaced ones are struck through. It can ask for approval before it runs, and collapses to one line.

On this page
Used for
  • Show an agent's plan
  • Approve a plan first
  • Track step progress
  • Edit steps before a run
  • Collapse to one line

Examples

Installation

npx knowns-ui@latest add agent-plan
For Claude Code, Cursor or Codex: installs it and wires the props to your own data.

Props

steps
PlanStep[]
Default[]
The plan, in order: { id, title, detail?, status?, startedAt?, endedAt?, steps?, replacedBy? }. Status is pending, active, done, skipped or failed.
run
AgentRun
Read live state from a run: a step whose id matches a task takes its status, times and summary.
actor
string
With run: this agent's tasks that are not in steps are added at the end.
title / goal
ReactNode
Default"Plan" / -
The header and one or two lines on what the plan is for.
onApprove / onEdit
() => void
Show Approve plan and Edit plan while nothing has started.
approval
string
With run: an approval request id. While it is pending, the buttons resolve it as approved or denied.
approveLabel / editLabel
string
Default"Approve plan" / "Edit plan"
Button text.
collapsed / defaultCollapsed / onCollapsedChange
boolean / boolean / (collapsed) => void
Defaultfalse
One summary line instead of the list, e.g. “Step 3 of 7: Run the full test suite”. The header toggles it.
collapsible
boolean
Defaulttrue
Let the header toggle the collapsed view.
announce
boolean
Defaulttrue
Announce step changes in a polite live region.
onStepToggle
(id, done) => void
Opt-in: each step marker becomes a checkbox the reader can tick (a demo, a manual checklist). You update steps. Without it the markers are read-only.
PlanStepMarker
component
The step marker on its own (status, n, small), for step lists outside a plan. Takes the step statuses plus waiting, an amber clock for a step that needs a person.
now
() => number
DefaultDate.now
Clock for elapsed times.

From a run

Preview

Collapsed

Preview

What it handles

  1. 01Lists planned steps with a status of pending, active, done, skipped or failed, and sub-steps with elapsed times under each step.
  2. 02Reads the same plan from a run, where a task with a matching step id takes over its live state and extra tasks join the end.
  3. 03Shows a hairline progress bar and a done count such as 2/5, leaving replaced steps out of the total.
  4. 04Shows Approve plan and Edit plan while nothing has started or an approval is pending, and resolves that approval as approved or denied.
  5. 05Animates plan changes: new steps fade in, removed ones fade out and moved ones slide to their new place.
  6. 06Folds to one summary line with collapsed, and turns each marker into a checkbox only when you pass onStepToggle.

States

First render
Nothing. It paints as it is
none
A step is added
It fades in and slides up
280ms, ease out
A step is removed
It fades out before it unmounts
180ms, ease out
Steps reorder
Rows slide from their old place
280ms, ease out
A step turns done
The check draws itself
180ms, ease out
Marker hover
The checkbox tints
120ms, ease out
Reduced motion
Steps appear, leave and move at once
0ms

Works with

When to use

When to use

  • Showing the steps an agent intends to take before it runs, with Approve plan and Edit plan.
  • Checking those steps off live, with elapsed times, sub-steps and a progress bar, as the plan changes.

When not to use

Using with AI

Use Copy page for AI above to give your assistant this page, Copy prompt under the install command to have it installed and wired to your data, or connect the Knowns UI MCP server and just ask:

  • Add the Knowns UI Agent Plan to my app and wire it to my own data.
  • I need showing the steps an agent intends to take before it runs, with Approve plan and Edit plan. Set that up with the Knowns UI Agent Plan.
  • Which Agent Plan props do I need for a minimal setup? Show me a short example.

With the server connected, your assistant calls get_component({ name: "agent-plan" }) and search_docs({ query: "agent plan" }).

Need help?

Stuck on Agent Plan, or found something off? We read every message.