# Plan

A proposed plan with collapsible steps and a button to run it.

- **Use it for**: A proposed plan with its steps and a button to run it.
- **Not for**: What already happened. Try [AgentSteps](https://unseenui.com/components/agent-steps/), [DryRunPreview](https://unseenui.com/components/dry-run-preview/).

## Installation

```bash
npm install @stackunseen/ui
```

## Usage

```tsx
import { Plan } from '@stackunseen/ui/assistant';
import '@stackunseen/ui/styles.css';

<Plan title="Rewrite the docs" steps={steps} actions={<Button>Build</Button>} />
```

## All props

| Prop | Type | Description |
| --- | --- | --- |
| `actions` | `ReactNode` | Footer actions such as a host-validated "Build" button. |
| `className` | `string` |  |
| `defaultOpen` | `boolean` |  |
| `description` | `string` |  |
| `headingLevel` | `3 \| 2 \| 4 \| 5 \| 6` |  |
| `labels` | `Partial<PlanLabels>` | Replaces the built-in wording, for example to translate it. |
| `onOpenChange` | `((open: boolean) => void)` |  |
| `open` | `boolean` |  |
| `steps` | `readonly PlanStep[]` |  |
| `streaming` | `boolean` | True while the host is still streaming the plan. |
| `title` (required) | `string` |  |

## Keyboard

Tab reaches controls; Enter or Space activates buttons. Accordions use arrow keys, Home and End. Select menus support arrows and typeahead; Escape closes menus and dialogs and restores focus.

## Works with

[AgentSteps](https://unseenui.com/components/agent-steps/), [ToolCall](https://unseenui.com/components/tool-call/), [ToolResult](https://unseenui.com/components/tool-result/), [ToolGroup](https://unseenui.com/components/tool-group/), [ExecutionTimeline](https://unseenui.com/components/execution-timeline/), [RunInspector](https://unseenui.com/components/run-inspector/), [UsageMeter](https://unseenui.com/components/usage-meter/), [RunBoard](https://unseenui.com/components/run-board/), [AgentLanes](https://unseenui.com/components/agent-lanes/), [SubagentTree](https://unseenui.com/components/subagent-tree/), [WorkflowGraph](https://unseenui.com/components/workflow-graph/), [AttentionQueue](https://unseenui.com/components/attention-queue/)

Page: https://unseenui.com/components/plan/
