Agent Log
agent-logWhat an agent did, as a tree that draws itself: each step opens its own height, the guide strokes out to it, and nested results branch beneath. Pure CSS, so it is a server component.
"use client";
import { FileText, Globe, Search, TriangleAlert } from "lucide-react";
import { useEffect, useState } from "react";
import { Button } from "@/components/forme/button/button";
import { AgentLog, AgentLogItem, AgentLogWorking } from "@/components/forme/blocks/agent-log/agent-log";
const results = [
"stripe.com/docs/billing/subscriptions/prorations",
"paddle.com/help/manage/proration",
"Proration: charge the difference, not the plan",
];
/** Each tick is one event from the agent. Yours would come from a stream. */
const EVENTS = 9;
export function AgentLogDemo() {
const [run, setRun] = useState(0);
const [tick, setTick] = useState(0);
const finished = tick >= EVENTS;
useEffect(() => {
if (finished) return;
const timer = setTimeout(() => setTick((current) => current + 1), tick === 0 ? 400 : 900);
return () => clearTimeout(timer);
}, [tick, finished]);
const reading = tick >= 5;
return (
<div key={run} className="flex w-full max-w-md flex-col gap-4">
<div className="rounded-xl border border-border bg-card lit edge p-4">
<AgentLog label="Research">
{tick >= 1 ? (
<AgentLogItem
icon={<Search />}
title="Searched the web for proration"
status={tick < 4 ? "running" : "done"}
meta={tick >= 4 ? "3 results" : undefined}
>
{tick >= 2 ? (
<AgentLog>
{results.slice(0, Math.min(3, tick - 1)).map((result) => (
<AgentLogItem key={result} icon={<Globe />} title={result} />
))}
</AgentLog>
) : null}
</AgentLogItem>
) : null}
{reading ? (
<AgentLogItem
icon={<FileText />}
title="Read billing/plans.ts"
detail="Upgrades already compute the remaining days"
meta="0.8s"
/>
) : null}
{tick >= 6 ? (
<AgentLogItem
icon={<TriangleAlert />}
title="Could not open billing/legacy.ts"
detail="The file was moved in #482"
status="error"
/>
) : null}
{tick >= 7 ? (
<AgentLogItem
icon={<FileText />}
title="Reading billing/invoices.ts"
status={tick < 8 ? "running" : "done"}
meta={tick >= 8 ? "1.1s" : undefined}
/>
) : null}
</AgentLog>
{finished ? null : <AgentLogWorking>{tick < 4 ? "Searching" : "Working"}</AgentLogWorking>}
</div>
<Button
variant="secondary"
size="small"
className="self-start"
onClick={() => {
setTick(0);
setRun((current) => current + 1);
}}
>
Run again
</Button>
</div>
);
}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.
AgentLog
What an agent did, as a tree that draws itself down the page.
| Prop | Type | Default | Description |
|---|---|---|---|
label | string | — | Names the list for screen readers: "Research", "Steps". |
Also takes every prop of <ol> attributes.
AgentLogItem
| Prop | Type | Default | Description |
|---|---|---|---|
title* | ReactNode | — | |
detail | ReactNode | — | A second line under the title: a path, a query, an excerpt. |
meta | ReactNode | — | Right-aligned and quiet: "0.8s", "5 results". |
icon | ReactNode | — | An icon before the title. |
status | 'done' | 'running' | 'error' | "done" | done reads quietly, running carries a sweep of light, error is in the destructive text. |
children | ReactNode | — | A nested AgentLog, for the results of this step. |
Also takes every prop of <li> attributes.
The other parts
AgentLogWorkingTakes<div>attributes
Related


Agent Thinking
The line above a chat composer while an agent works: a loader, the current activity under a sweep of light, an elapsed timer and a Stop button. Each new activity becomes a timed step you can unfold, and it finishes as “Worked for 14.2s”.
ai
ProPlan
The plan an agent proposes before it acts: a title, the approach, and numbered steps with the files each touches. It streams in with a waiting line for the next step, and offers Build and Revise only once it is complete.
ai
ProSubagent
A subagent the main agent delegated to: its role, its task, live stats, its own steps as a Trace, and the result it handed back. A card, so several can run side by side, folding to its header in a long transcript.
ai