npx tool-agent "integrate the plan component for step-by-step task workflows with status tracking"npx shadcn@latest add @tool-ui/planWhen the assistant breaks work into steps (a deployment pipeline, a research plan, a migration checklist) the Plan component turns that structure into a visual progress tracker. Each phase shows its status, and the overall shape of the work is scannable at a glance.
Role: State. Shows internal activity and progress. See Design Guidelines for how component roles work.
Run this once from your project root.
npx tool-agent "integrate the plan component for step-by-step task workflows with status tracking"npx shadcn@latest add @tool-ui/planCreate a backend tool that returns a serializable plan payload.
// Backend toolimport { tool } from "ai";const showPlan = tool({ description: "Display an implementation plan to the user", inputSchema: { type: "object", properties: { task: { type: "string" } }, required: ["task"], additionalProperties: false, }, async execute({ task }) { return { id: "plan-1", title: "Implementation Plan", description: "Steps to complete: " + task, todos: [ { id: "1", label: "Analyze requirements", status: "completed" }, { id: "2", label: "Implement solution", status: "in_progress" }, { id: "3", label: "Write tests", status: "pending" }, ], }; },});Drop this into your runtime provider so tool results render as Plan.
import { type Toolkit } from "@assistant-ui/react";import { Plan } from "@/components/tool-ui/plan";import { safeParseSerializablePlan } from "@/components/tool-ui/plan/schema";import { ToolUI } from "@/components/tool-ui/shared";export const toolkit: Toolkit = { showPlan: { type: "backend", render: ({ result }) => { const parsed = safeParseSerializablePlan(result); if (!parsed) { return null; } return ( <ToolUI id={parsed.id}> <ToolUI.Surface> <Plan {...parsed} /> </ToolUI.Surface> <ToolUI.Actions> <ToolUI.LocalActions actions={[ { id: "approve", label: "Approve Plan" }, { id: "revise", label: "Request Changes", variant: "secondary", }, ]} onAction={(actionId) => console.log(actionId)} /> </ToolUI.Actions> </ToolUI> ); }, },};Progress bar and "X of Y complete" at a glance
Distinct icons for pending, in progress, completed, and cancelled
Click any todo to reveal additional context
Visual feedback when all tasks complete
Prop
Type
Use ToolUI.LocalActions to compose external actions below Plan.
Use Plan.Compact for a steps-only card body:
Prop
Type
Prop
Type
motion-safe variantsmotion-reduce overrides