Skip to content
PlanningTaskMenu

Task

A single task row: status, title, mono detail, a live timer that becomes a duration, and details on demand.

Done with a duration, running with a live timer, failed with details, blocked, skipped and pending.

Installation

$ pnpm dlx shadcn@latest add https://chatcn.dev/r/task.json

Usage

tsx
import { Task } from "@/components/ui/chatcn/task"

<Task status="in-progress" title="Run the test suite" activeTitle="Running the test suite" detail="pnpm test" />

<Task status="failed" title="Build the docs" detail="pnpm build">
  Type error in app/runs/page.tsx. Regenerate the types, then build again.
</Task>

Task also exports TaskStatusGlyph, the 16 px status mark that Plan, TodoList, Subagent and Workflow share, so a status looks the same everywhere.

Statuses

StatusShows
pendingA hollow ring: a place in the queue
in-progressThe spinner, the active title in medium weight
doneAn ink disc whose check draws itself in 180 ms
blockedA circled minus and the reason underneath
skippedA dashed ring, struck through and dimmed
failedA red cross with the word Failed
cancelledA stop glyph, dimmed

Props

PropTypeNotes
statusTaskStatusOne of the seven statuses above
titleReactNodeImperative form
activeTitleReactNodeShown while in progress
detailReactNodeMono context; truncates first
metaReactNodeReplaces the timer or status text
durationMs, startedAtnumberMeasured automatically when omitted
childrenReactNodeExpandable details; failed and blocked tasks open by themselves
open, defaultOpen, onOpenChangeControlled or uncontrolled

Keyboard

KeyAction
Enter, SpaceExpand or collapse the details

Accessibility

  • Rows with details are real buttons with aria-expanded, from Base UI Collapsible.
  • The status is spoken before the title; failure is never color alone.
  • The timer is not a live region: a timer that speaks every second is noise.

Motion

  • Status changes swap the glyph with a 150 ms blur crossfade; done draws its check.
  • Details open over 200 ms and the chevron turns with them. Reduced motion snaps.