Task List
task-listAn agent's plan and its progress: pending, running, done and failed tasks with a progress bar and a count. Built on Trace and stateless, so you pass the current tasks on each update, and each status is written out for screen readers.
"use client";
import { useEffect, useState } from "react";
import { TaskList } from "@/components/forme/task-list/task-list";
import type { Task, TaskStatus } from "@/components/forme/task-list/task-list";
const plan = [
{ id: "1", title: "Read the billing schema", detail: "packages/db/schema.ts" },
{ id: "2", title: "Find the Forme components to use", detail: "data-table, stat, toast" },
{ id: "3", title: "Write the invoices page", detail: "app/billing/invoices/page.tsx" },
{ id: "4", title: "Add the export action", detail: "Not needed: the table already exports" },
{ id: "5", title: "Run the type check" },
];
const TICKS_PER_TASK = 4;
// A pretend agent: a tick every 300ms, four to a task, then the run restarts.
// The third task reports its progress; the fourth is dropped from the plan.
export function TaskListDemo() {
const [tick, setTick] = useState(0);
useEffect(() => {
const timer = setInterval(
() => setTick((current) => (current > (plan.length + 1) * TICKS_PER_TASK ? 0 : current + 1)),
300,
);
return () => clearInterval(timer);
}, []);
const step = Math.floor(tick / TICKS_PER_TASK);
const tasks: Task[] = plan.map((task, index) => {
let status: TaskStatus = index < step ? "done" : index === step ? "running" : "pending";
if (index === 3 && index <= step) status = "cancelled";
const progress =
index === 2 && status === "running" ? ((tick % TICKS_PER_TASK) + 1) * 25 : undefined;
return { ...task, status, progress };
});
return <TaskList className="w-full max-w-md" title="Building the invoices page" tasks={tasks} />;
}Install
Adds the component, its registry dependencies, and the token stylesheet you import once.
API reference
Read from the source, so it is the API of the file you install. A prop marked * is required.
TaskList
An agent's plan, and how far it has got.
| Prop | Type | Default | Description |
|---|---|---|---|
tasks* | readonly Task[] | — | |
title | ReactNode | — | Heading for the list, e.g. "Building the billing page". |
Also takes every prop of <div> attributes.
Related


Loader
Eight loading indicators — ring, dots, bars, a dot-grid wave and orbit, a terminal braille spinner, a figure-eight comet and sparkles. Pure CSS in a server component, sized in em and coloured by currentColor, with a still frame under reduced motion.
feedback

Progress
A determinate progress bar with its label and value, both announced to a screen reader by the Base UI parts rather than by hand-written aria attributes. A null value renders as indeterminate and dims the track so it reads as waiting.
feedback

Alert
An inline message in four states, with a matching icon, an optional title and room for an action. Only the destructive state interrupts a screen reader; the rest wait their turn.
feedback