Task
A collapsible agent execution log with spring height expansion, staggered task rows, status indicators, error shakes, and crisp file chips.
Customize
Installation
npx shadcn@latest add @kinetic/taskUsage
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.
| Prop | Type | Default | Description |
|---|---|---|---|
open / defaultOpen / onOpenChange | boolean / boolean / (open: boolean) => void | true | Controlled or initial expanded state. |
animated / speed / blurPx / staggerMs | boolean / number / number / number | true / 0.45 / 8 / 95 | Controls motion activation, speed scale, initial blur (px), and row stagger delay (ms). |
keepMounted / disabled | boolean / boolean | false / false | Keeps task items mounted when closed or disables trigger clicks. |
TaskTrigger / TaskContent
Rotating-chevron disclosure trigger and height-animated TaskItem container.
| Prop | Type | Default | Description |
|---|---|---|---|
title / icon / showChevron (TaskTrigger) | React.ReactNode / React.ReactNode | false / boolean | "Task" / default icon / true | Fallback title text, custom leading icon or false to hide, and chevron toggle. |
keepMounted / forceMount (TaskContent) | boolean / boolean | false | Preserves DOM nodes while collapsed. |
TaskItem / TaskItemFile
Animated execution log row (staggerReveal, drawStroke, WAAPI spinner, shake) and crisp file badge.
| Prop | Type | Default | Description |
|---|---|---|---|
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. |