Chat Plan
A plan an agent proposed in chat. Each step shows if it is not started, in progress, complete, or failed. The header counts completed steps.
Installation
pnpm dlx shadcn@latest add https://sprout.tulipfarm.ai/r/chat-plan.jsonCopies Chat Plan and the components it uses (Spinner) into your app, installs the packages, and adds the styles. Then import it from @/components/ui/chat-plan. Needs Tailwind CSS 4 and a components.json from shadcn init.
Install the following dependencies:
pnpm add clsx tailwind-merge @hugeicons/core-free-icons @hugeicons/reactAdd Sprout base once per app: the
cn()helper and the design tokens.lib/sprout/classes.ts- Design tokens, for your global CSS
Add the components it uses: Spinner.
Copy and paste the following code into your project.
import type { ComponentProps } from 'react'; import { CheckIcon } from '@/lib/sprout/icons/check-icon'; import { ClockIcon } from '@/lib/sprout/icons/clock-icon'; import { WarningIcon } from '@/lib/sprout/icons/warning-icon'; import { cn } from '@/lib/sprout/classes'; import { Spinner } from '@/components/ui/spinner'; export const chatPlanStepStateNames = ['pending', 'running', 'complete', 'error'] as const; export type ChatPlanStepState = (typeof chatPlanStepStateNames)[number]; export type ChatPlanStep = { id: string; title: string; detail?: string | undefined; state: ChatPlanStepState; }; export interface ChatPlanProps extends Omit<ComponentProps<'section'>, 'title' | 'children'> { title: string; steps: readonly ChatPlanStep[]; } const stateLabels: Record<ChatPlanStepState, string> = { pending: 'Not started', running: 'In progress', complete: 'Complete', error: 'Failed', }; function StepIcon({ state }: { state: ChatPlanStepState }) { if (state === 'running') return <Spinner aria-hidden="true" />; if (state === 'complete') return <CheckIcon size="md" aria-hidden="true" />; if (state === 'error') return <WarningIcon size="md" aria-hidden="true" />; return <ClockIcon size="md" aria-hidden="true" />; } export function ChatPlan({ title, steps, className, ...props }: ChatPlanProps) { const complete = steps.filter(step => step.state === 'complete').length; return ( <section data-slot="chat-plan" aria-label={title} {...props} className={cn('sprout-chat-plan', className)}> <div className="sprout-chat-plan-header"> <h4 className="sprout-chat-plan-title">{title}</h4> <span className="sprout-chat-plan-count"> {complete} of {steps.length} complete </span> </div> {steps.length === 0 ? ( <p className="sprout-chat-plan-empty">No steps have been proposed yet.</p> ) : ( <ol className="sprout-chat-plan-steps"> {steps.map(step => ( <li key={step.id} data-slot="chat-plan-step" data-state={step.state} className="sprout-chat-plan-step"> <span key={step.state} className="sprout-chat-plan-icon"> <StepIcon state={step.state} /> </span> <div className="sprout-chat-plan-text"> <p className="sprout-chat-plan-step-title"> {step.title} <span className="sprout-chat-plan-sr-only"> {' · '} {stateLabels[step.state]} </span> </p> {step.detail && <p className="sprout-chat-plan-detail">{step.detail}</p>} </div> </li> ))} </ol> )} </section> ); }And the files it imports:
lib/sprout/icons/check-icon.tsxlib/sprout/icons/clock-icon.tsxlib/sprout/icons/create-icon.tsxlib/sprout/icons/warning-icon.tsx
Add the styles to your global CSS, after
@import "tailwindcss".@layer components { .sprout-chat-plan { box-sizing: border-box; border: 1px solid var(--sprout-line); border-radius: var(--sprout-radius-panel); width: 100%; min-width: 0; color: var(--sprout-text); font-family: var(--sprout-font); padding: 16px; } .sprout-chat-plan-header { flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 8px; margin-bottom: 16px; display: flex; } .sprout-chat-plan-title { min-width: 0; font-size: var(--sprout-text-sm); overflow-wrap: anywhere; margin: 0; font-weight: 500; line-height: 1.25rem; } .sprout-chat-plan-count { color: var(--sprout-muted); font-size: var(--sprout-text-xs); font-variant-numeric: tabular-nums; white-space: nowrap; line-height: 1rem; } .sprout-chat-plan-empty { color: var(--sprout-muted); font-size: var(--sprout-text-sm); margin: 0; line-height: 1.25rem; } .sprout-chat-plan-steps { gap: 16px; margin: 0; padding: 0; list-style: none; display: grid; } .sprout-chat-plan-step { gap: 12px; min-width: 0; display: flex; } .sprout-chat-plan-icon { width: 16px; height: 20px; color: var(--sprout-muted); flex-shrink: 0; justify-content: center; align-items: center; display: inline-flex; } .sprout-chat-plan-step[data-state="complete"] .sprout-chat-plan-icon { color: var(--sprout-success); } .sprout-chat-plan-step[data-state="error"] .sprout-chat-plan-icon { color: var(--sprout-danger); } .sprout-chat-plan-text { min-width: 0; } .sprout-chat-plan-step-title, .sprout-chat-plan-detail { font-size: var(--sprout-text-sm); overflow-wrap: anywhere; margin: 0; line-height: 1.25rem; } .sprout-chat-plan-step-title { font-weight: 500; } .sprout-chat-plan-detail { color: var(--sprout-muted); margin-top: 4px; } .sprout-chat-plan-sr-only { clip-path: inset(50%); white-space: nowrap; border: 0; width: 1px; height: 1px; margin: -1px; padding: 0; position: absolute; overflow: hidden; } @media (prefers-reduced-motion: no-preference) { .sprout-chat-plan-icon { animation: sprout-chat-plan-icon-in var(--sprout-motion-normal, .18s) var(--sprout-motion-ease, ease-out); } } @keyframes sprout-chat-plan-icon-in { from { opacity: 0; scale: .8; } } }Import it from
@/components/ui/chat-plan. Update the paths if your@/alias points elsewhere.
pnpm add @tulipfarm/sprout@import "tailwindcss";
@import "@tulipfarm/sprout/styles.css";The package keeps the source and ships fixes with each release. Import from @tulipfarm/sprout/chat-plan.
Fill in missing suppliers
2 of 4 completeFind deliveries with no supplier · Complete
Search the Supplier deliveries table for empty Supplier fields.
Match each delivery to a supplier by invoice number · Complete
Show the matches for review · In progress
Nothing changes until you approve.
Update 42 delivery records · Not started
Usage
import { ChatPlan, type ChatPlanStep } from "@tulipfarm/sprout/chat-plan";
const steps: ChatPlanStep[] = [
{ id: "find", title: "Find deliveries with no supplier", state: "complete" },
{ id: "match", title: "Match each delivery to a supplier", state: "running" },
{ id: "update", title: "Update 42 delivery records", state: "pending" },
];
<ChatPlan title="Fill in missing suppliers" steps={steps} />title: the plan name. It also names the section.steps:{ id, title, detail?, state }[], in order.stateispending,running,complete, orerror.detailis one optional line under the title.
Chat Plan has one look and one size. It fills the width it gets.
Step states
Complete shows a green check, in progress a spinner, failed a red warning, and not started a clock.
Fictional garden plan
1 of 4 completeChoose a patch · Complete
A sunny place near water.
Prepare the soil · In progress
Order bulbs · Failed
The sample supplier is unavailable.
Plant the bulbs · Not started
Empty plan
With no steps, the plan says none were proposed yet.
New plan
0 of 0 completeNo steps have been proposed yet.
In the canvas
A to-do result opens in the Canvas. Wrap the plan in CanvasSection with no title, so the plan's own title leads.
<CanvasSection>
<ChatPlan title={item.title} steps={item.steps} />
</CanvasSection>Launch checklist
2 of 5 completeDraft the launch brief · Complete
Saved to Launch week › Brief.
Pull the press contact list from Contacts · Complete
86 contacts tagged Press.
Write the announcement emails · In progress
Schedule sends for Tuesday 9:00 · Not started
Report opens and replies on Friday · Not started
Long content
Long titles, links, and details wrap. The count moves below the title when space runs out.
Move supplier deliveries from the legacy accounting export
1 of 3 completeExport https://files.example.com/workspaces/tulipfarm/exports/supplier-deliveries-2026-q3-final-v2.csv · Complete
The export finished with 1,204 rows and 18 columns.
Import the rows into Supplier deliveries · Failed
The column InvoiceReferenceNumberFromLegacyAccountingSystem has no matching field. Pick a field or skip the column.
Tell the operations channel when the import is done · Not started
Accessibility
The plan is a section named by its title, which is anh4. Steps are an ordered list. Icons are hidden; each step ends with hidden text such as “In progress” or “Failed”, so screen readers hear the state.
When a step changes state its icon fades in over 180ms; with reduced motion it changes at once.
Theme tokens
The border uses --sprout-line, muted text and pending icons--sprout-muted, complete icons--sprout-success, and failed icons--sprout-danger.