Skip to main content

Task

A collapsible agent execution log with spring height expansion, staggered task rows, status indicators, error shakes, and crisp file chips.

@heroicons/react
Resolved spring tokens in motion-tokens.ts (completed)
Verified shared reveal helpers in effects.ts (completed)
Bundling registry item task.json (running)

Customize

Speed0.45
Blur reveal (px)8
Item stagger (ms)95

Installation

npx shadcn@latest add @kinetic/task

Usage

Combine Task, TaskTrigger, TaskContent, TaskItem, and TaskItemFile to stream step-by-step file reads and command output.

import {
  Task,
  TaskContent,
  TaskItem,
  TaskItemFile,
  TaskTrigger,
} from "@/components/kinetic/ui/task";

export function WorkspaceTaskLog() {
  return (
    <Task defaultOpen>
      <TaskTrigger title="Inspecting registry files" />
      <TaskContent>
        <TaskItem status="completed">
          Read <TaskItemFile>registry.json</TaskItemFile>
        </TaskItem>
        <TaskItem status="running">
          Checking <TaskItemFile>docs-ai.ts</TaskItemFile>
        </TaskItem>
        <TaskItem status="pending">Verify markdown routes</TaskItem>
      </TaskContent>
    </Task>
  );
}

Status indicators and file chips

Each TaskItem accepts status as pending, running, completed, or error. Completed rows draw a checkmark via drawStroke, running rows rotate SpinnerIcon, and error rows trigger a horizontal shake. Inline TaskItemFile chips reveal smoothly and detect custom SVG icons automatically.

import {
  Task,
  TaskContent,
  TaskItem,
  TaskItemFile,
  type TaskItemStatus,
  TaskTrigger,
} from "@/components/kinetic/ui/task";

interface TaskEntry {
  readonly id: string;
  readonly label: string;
  readonly file?: string;
  readonly status: TaskItemStatus;
}

interface TaskRunLogProps {
  readonly title: string;
  readonly entries: readonly TaskEntry[];
}

export function TaskRunLog({ title, entries }: TaskRunLogProps) {
  return (
    <Task defaultOpen>
      <TaskTrigger title={title} />
      <TaskContent>
        {entries.map((entry) => (
          <TaskItem key={entry.id} status={entry.status}>
            {entry.label}{" "}
            {entry.file ? <TaskItemFile>{entry.file}</TaskItemFile> : null}
          </TaskItem>
        ))}
      </TaskContent>
    </Task>
  );
}

Motion preferences

Task uses speed={0.45}, blurPx={8}, and staggerMs={95} by default. Both initial items and dynamically appended rows animate smoothly, while reduced motion disables shakes, spinners, stagger reveals, and height springs cleanly.

API Reference

Task

Zero-dependency collapsible task container managing disclosure state and shared motion parameters.

PropTypeDefaultDescription
open / defaultOpen / onOpenChangeboolean / boolean / (open: boolean) => voidtrueControlled or initial expanded state.
animated / speed / blurPx / staggerMsboolean / number / number / numbertrue / 0.45 / 8 / 95Controls motion activation, speed scale, initial blur (px), and row stagger delay (ms).
keepMounted / disabledboolean / booleanfalse / falseKeeps task items mounted when closed or disables trigger clicks.

TaskTrigger / TaskContent

Rotating-chevron disclosure trigger and height-animated TaskItem container.

PropTypeDefaultDescription
title / icon / showChevron (TaskTrigger)React.ReactNode / React.ReactNode | false / boolean"Task" / default icon / trueFallback title text, custom leading icon or false to hide, and chevron toggle.
keepMounted / forceMount (TaskContent)boolean / booleanfalsePreserves DOM nodes while collapsed.

TaskItem / TaskItemFile

Animated execution log row (staggerReveal, drawStroke, WAAPI spinner, shake) and crisp file badge.

PropTypeDefaultDescription
status (TaskItem)"pending" | "running" | "completed" | "error""pending"Drives drawStroke checkmark, WAAPI spinner, or error row shake.
icon (TaskItem / TaskItemFile)React.ReactNode | false-Custom icon override or false on TaskItemFile to omit the document icon.