Task
A multi-step agent process as an ordered list of steps, aligned to the useAgent step shape, with the final answer distinguished.
Task
The Task primitive renders a multi-step agent process as an ordered list of steps. Each TaskItem shows its index, tool, status, and — when expanded — args and observation, with the finish step styled as the distinguished final answer. Its data shape mirrors @localmode/react useAgent steps ({ index, type, toolName, toolArgs, observation, result }) so agent UIs wire up without adapters.
Preview
Installation
pnpm dlx shadcn@latest add @localmode/ui/conversation/tasknpx shadcn@latest add @localmode/ui/conversation/taskyarn dlx shadcn@latest add @localmode/ui/conversation/taskbunx --bun shadcn@latest add @localmode/ui/conversation/taskData source & dependencies
Data source: renders the step list you pass — works with any backend. Recommended producer: useAgent().steps from @localmode/react (on-device, optional).
clsx+tailwind-merge— via the sharedcn()util (installed automatically as a registry dependency)
Files installed
task.tsx—Task+TaskItemlib/utils.ts— thecn()helper (if not already present)
Props
TaskItem
Prop
Type
Examples
Render agent steps
import { useAgent } from '@localmode/react';
import { Task, TaskItem } from '@/components/task';
const { steps } = useAgent({ model, tools });
<Task>
{steps.map((s) => <TaskItem key={s.index} step={s} />)}
</Task>Customization
For a richer vertical timeline with durations, finish-reason badges, and nested sub-agents, use Agent Step Timeline. Task is the lighter, list-style option.
These primitives are presentational and hook-driven: they render props and emit callbacks, holding only local view state. The orchestration state (e.g. useAgent) lives in your app. Every surface uses shadcn/ui CSS-variable utilities, so it inherits your theme — restyle the copied file freely.