Plan
Show the plan an agent proposes before it acts, stream its steps in, and let the person approve or revise it.
Overview
Plan shows what an agent intends to do before it does it: a title, a short summary, and the steps in order. The person approves it or asks for a revision.
It shows the plan and status you pass. Once the plan runs, track the work with Task Rows.
Anatomy
- HeaderThe title, the step count or status, and the disclosure
- SummaryWhat the plan sets out to do
- StepsNumbered steps, each with an optional detail
- ActionsRevise and Approve, while the plan is proposed
Installing plan brings Button, Collapsible, and Text Shimmer along as registry dependencies.
Behavior
Status
Streaming
Append steps to the array as they arrive and keep status at streaming. Steps present on the first render appear at once; later ones fade in. Set status to proposed when the plan is complete.
Collapsing
The header opens and closes the steps. It starts open; pass defaultOpen={false}, or control it with open and onOpenChange, to collapse a decided plan.
Approve and Revise
Each button appears only when you pass its handler. Changing status after the person answers is your application's work.
Accessibility
The plan is a region named by its title. The header is a button that reports whether the steps are expanded. The steps are an ordered list, and each one is read with its number, such as "Step 2: Find the rows that broke the schema". While streaming the region is marked busy, and a status message announces when the plan is ready and when it is decided. With reduced motion, new steps appear without fading.
Installation
Usage
import { Plan } from "@/components/ai/plan"
<Plan
title={plan.title}
summary={plan.summary}
steps={plan.steps}
status={plan.isStreaming ? "streaming" : plan.decision ?? "proposed"}
onApprove={() => agent.approvePlan(plan.id)}
onRevise={() => composer.focus()}
/>Examples
Streaming
Steps arrive one by one, then the actions appear.
API reference
Plan
Accepts native section props beyond those listed.