aiellie

Search

Find a component, template or page

GitHub
Components

Agent Steps

An agent's run laid out step by step: a row that reads Working while it runs and Worked for 12s after, folding open to each step's status, a line of detail and the results it found.

  1. Searched for container query support, In progress
  2. Read app/components/chart.tsx, Not started
  3. Sized the chart from its container, Not started
Open full screen
fig. 01 · open it full screen from the corner

Installation

npx shadcn@latest add "@aiellie/agent-steps"

shadcn needs the @aiellie registry in components.json first. npx aiellie add agent-steps adds it on its first run, then installs the same way.

Agent Steps lays out what an agent did as a list of steps under one row. While it runs, the row reads Working with a live count and the steps fill in below it. Once it's done, the row folds shut and reads "Worked for 12s", and opens again on a click.

Each step has a status. A finished step shows its own icon or a tick, the step in progress shows a live dot with a shimmer, and a failed one turns destructive. Under its label a step can carry a line of detail, the results it found, or anything else.

Getting started

  1. List the steps

    streaming opens it and shows the indicator. duration is how many seconds the run took, which the row shows once it's done.

    components/run.tsx
    import { Globe02Icon } from "@hugeicons/core-free-icons"
    
    import {
      AgentStep,
      AgentStepResult,
      AgentStepResults,
      AgentSteps,
      AgentStepsContent,
      AgentStepsTrigger,
    } from "@/components/aiellie/agent-steps"
    
    export function Run({ streaming }: { streaming: boolean }) {
      return (
        <AgentSteps streaming={streaming} duration={18}>
          <AgentStepsTrigger />
          <AgentStepsContent>
            <AgentStep icon={Globe02Icon} label="Searched for container queries">
              <AgentStepResults>
                <AgentStepResult href="https://developer.mozilla.org">
                  MDN
                </AgentStepResult>
              </AgentStepResults>
            </AgentStep>
            <AgentStep status="active" label="Reading chart.tsx" />
          </AgentStepsContent>
        </AgentSteps>
      )
    }

Anatomy

<div data-slot="agent-steps" data-streaming> {/* Base UI Collapsible */}
  <button data-slot="agent-steps-trigger" />
  <div data-slot="agent-steps-content">
    <ol>
      <li data-slot="agent-step" data-status="done">
        <p data-slot="agent-step-detail" />
        <ul data-slot="agent-step-results">
          <li data-slot="agent-step-result" />
        </ul>
      </li>
    </ol>
  </div>
</div>

A rail joins each step's mark to the next one's. Each step's status is read out after its label, so the list makes sense without the icons.

It opens while streaming is on and folds when it turns off, unless someone opened or shut it themselves, which it then leaves alone. That's the same as Reasoning, so the two read alike side by side.

Examples

A step that failed

A failed step turns its mark destructive. Steps after it can stay pending, in muted ink.

  1. Installed dependencies, Done
  2. Ran the test suite, Failed

    2 of 48 tests failed in auth.test.ts.

  3. Open a pull request, Not started

API reference

AgentSteps

PropTypeDefaultDescription
streamingbooleanfalseWhether the agent is still working.
durationnumberSeconds the run took, once it's done.
startedAtDate | numberwhen streaming turned onWhen it started, so the count survives a remount.
open, defaultOpenbooleanstreamingHolds it, or starts it, open.
onOpenChange(open: boolean) => void

All other Collapsible.Root props are forwarded.

AgentStepsTrigger

PropTypeDefaultDescription
labelReactNode"Working"What it says while the agent works.
childrenReactNodeReplaces the label in every state.

AgentStep

PropTypeDefaultDescription
labelReactNoderequiredWhat the step does.
status"pending" | "active" | "done" | "error""done"
iconIconSvgElementa tickShown once the step is done, like a globe for a search.
childrenReactNodeDetail, results, or anything else under the label.

AgentStepResult

PropTypeDefaultDescription
hrefstringMakes the chip a link that opens in a new tab.

AgentStepsContent, AgentStepDetail and AgentStepResults forward their element's props.