Skip to main content

Chat

TodoList

An agent's plan, step by step: each step with whether it is to do, under way or done, under one line that counts them, "Plan · 2 of 5". It is open while any step is left, and folds to that line once every step is done; once the person opens or closes it, their choice holds. Each step's status is said in words to a screen reader, not only by its icon. It is built on Collapsible.

  1. Read the recipes in the shared folder, done
  2. Pick three weeknight dinners, done
  3. Build the grocery list, doing now
  4. Book Thursday's delivery, to do

Install

Hand it to your agent
Add TodoList from Ouro UI to this app. Read https://ui.ouroboros.bot/docs/todo-list.md first and follow it.

Or by hand. Once per app, with Tailwind CSS v4 and an @/* path alias (Ouro HX is built on Base UI, so --base base; skip -t in an existing app):

npx shadcn@latest init --base base --preset nova --yes --no-monorepo
npx shadcn@latest add ourostack/ouro-ui/ouro-base#v1.3.823

Then the component (Installing):

npx shadcn@latest add ourostack/ouro-ui/todo-list#v1.3.823
import { TodoList } from "@/components/ouro/todo-list/todo-list";

Paths use shadcn's default @/ alias; the CLI rewrites them to yours.

Example

<TodoList items={[
  { id: "1", title: "Read the recipes", status: "done" },
  { id: "2", title: "Build the grocery list", status: "in_progress" },
  { id: "3", title: "Book the delivery", status: "pending" },
]} />

Usage

Its agent side, todoListAx in todo-list-styles.ts, lets an agent read the plan. It offers no action: the agent writes its plan through its own runtime.

Use instead when

  • Use Checklist instead for a list the person ticks off themselves, and ToolCallGroup for the calls an agent made.

Props

Type: TodoListProps.

className
Type: string
Layout only: margins, width (mt-2). Appearance classes warn in development.
defaultOpen
Type: boolean
Opens it first and keeps it open after every step is done, until the person closes it.
items (required)
Type: readonly TodoItem[]
The agent's steps, in its order. With none, TodoList renders nothing.
label
Type: string
Default: "Plan"
The title's first word, before the count: "Plan · 2 of 5".
onOpenChange
Type: ((open: boolean) => void)
Called with the new state when the person opens or closes it.
open
Type: boolean
Whether it is open, when you control it. Pair it with onOpenChange.
ref
Type: Ref<HTMLDivElement>
Reaches the rendered element.

Don't use

These are not props. Passing one fails the type check with the fix in the error, and in development a console message names the fix.

  • tasks: Not a prop. The steps are items: <TodoList items={[{ id, title, status }]}>.
  • title: Not a prop. The title's word is label: <TodoList label="Plan">.
  • todos: Not a prop. The steps are items: <TodoList items={[{ id, title, status }]}>.

className is for layout only

Pass margins, width and grid placement (mt-4, w-full, col-span-2).

Appearance comes from props, not classes. In development, a class that sets appearance logs one warning per component instance, naming the prop to use instead. A class sets appearance when, after its variants (hover:, sm:) and any ! are removed, it starts with bg-, text-, border-, rounded-, shadow-, font-, ring-, from-, via-, to-, fill- or stroke-, or is border, rounded, shadow or ring, or has a dark: variant. Text wrapping, overflow and table layout classes (text-wrap, text-ellipsis, border-collapse) are layout and do not warn.

Alignment classes (text-center) warn too: set alignment on a parent element.

Types

TodoItem

One step of an agent's plan.

interface TodoItem {
  /** Your app's id for the step. */
  id: string;
  /** What the step is, as the agent wrote it: "Read the recipes". */
  title: string;
  /** Where it stands: `pending` (to do), `in_progress` (doing now) or `done`. */
  status: TodoStatus | (string & { 'Use "pending", "in_progress" or "done"': never });
}