A collapsible task list that shows an AI agent's plan and progress — status icons, rolling counts, and disclosure animation.
Live progress
Items advance from pending through in-progress to completed. The header count rolls, and Replay remounts the cycle.
Loading…
Installation
CLI
Also needs
npx @sonojs/ui@latest add agent-disclosure && npm i lucide-react motionUsage
todo-list.tsx
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| items | TodoItem[] | — | Tasks with id, title, and optional status/detail. |
| title | ReactNode | "To-dos" | Header label next to the list icon. |
| open / defaultOpen | boolean | true | Controlled or uncontrolled disclosure state. |
| onOpenChange | (open: boolean) => void | — | Fires when the header expands or collapses. |
| collapseOnComplete | boolean | true | Auto-collapses when every item is completed. |
| maxHeight | number | 248 | Scroll viewport max height in pixels. |
| className | string | — | Optional class names on the root section. |