All components (283)
Plan
AI · Plan
What it is and when to use it
The plan an agent proposes and goes on fulfilling: its steps in order, each with its state and the progress ("2 of 5") in the title.
When to use it
- Showing what an agent is going to do or is doing, so whoever supervises it can follow it and stop it in time.
stepsare the steps:{ key, label, status?, detail? }. Withoutstatus, a step is pending.streamingtells the screen reader that the plan changes.- Progress counts done and skipped steps as finished.
When not to
- Steps a person goes through in an assistant:
StepsorWizard. - A record of what happened, without order:
ActivityLog. - A single tool call:
ToolCall.
Keyboard: the title is the button that folds and opens: Tab, Enter or Space. There is nothing else to focus inside.
Accessibility: the state of each step is seen through the icon (tick, cross, spinning ring, empty circle, dash) and said with hidden text: colour is not the only thing that informs. The list carries a name and, while it is being written, aria-busy.
Fine-tuning: amset-plan and the amset-plan__* classes; the icons use the text tones of success, error and accent.
What it looks like
I review last month's orders and prepare a reminder for each customer with an overdue invoice.
- DoneRead last month's orders1.2 sec
- DoneGroup by customer3.4 sec312 customers
- In progressWork out each customer's total
- PendingGenerate the unpaid reminders
- PendingSend the emails
<Plan
title="Warn customers with unpaid invoices"
description="I review last month's orders and prepare a reminder for each customer with an overdue invoice."
steps={[
{ key: "1", label: "Read last month's orders", status: "done" },
{ key: "2", label: "Group by customer", status: "done", detail: "312 customers" },
{ key: "3", label: "Work out each customer's total", status: "active" },
{ key: "4", label: "Generate the unpaid reminders", status: "pending" },
{ key: "5", label: "Send the emails", status: "pending" },
]}
/>Props
Import it with import { Plan } from '@amset/ui'. Required props are marked.
| Prop | Type | What it does |
|---|---|---|
stepsrequired | readonly PlanStep[] | The steps, in order: `{ key, label, status?, detail? }`. Without `status`, a step is pending. |
titlerequired | string | What the plan is for: "Migrate the shop". |
className | string | Merged with the library classes; it does not replace them. |
defaultExpanded | boolean | Open at the start. Yes by default. |
description | string | What it proposes to do, in one sentence. |
streaming | boolean | The plan is still being written or run: tells the screen reader that it changes. |
It also accepts the attributes of the element it renders: className, style, data-*, aria-* and its events.
In the test bench
Every state and variant, to try one at a time, on its page at storybook.amsetui.com:
