# Agent showcase

> A features section that shows an AI agent at work: pick a task, watch it call its tools, open the output, check the sources and approve or undo the result.

Static screenshots of chat bubbles do not prove what an AI product actually does. Agent showcase puts three real production tasks beside a lit execution surface inside one hairline architectural frame. Picking a task—or switching between Fast route and Deep verify—rolls latency and token counters with NumberRoll and steps through each tool call in sequence. Visitors can unfold any tool row to read real structured output, click citation chips to inspect grounded evidence and approve or undo the final proposed action in place.

## Install

```bash
npx shadcn@latest add @hairline-pro/agent-showcase
```

Needs React 19, Tailwind CSS v4 and shadcn/ui theme variables (any style, light and dark). Icons from lucide-react.

- npm: `lucide-react`
- Hairline UI components it needs (the CLI installs them too): `number-roll`, `text-morph`
- Docs and live preview: https://hairlineui.com/blocks/agent-showcase
- Premium block, included with All-Access (https://hairlineui.com/buy/all-access?from=blocks). Installs only with an All-Access token through the @hairline-pro registry: https://hairlineui.com/ui/installation#premium. Its source isn't public.

## Usage

```tsx
import { AgentShowcase } from "@/components/agent-showcase";

<AgentShowcase
  eyebrow="Agent workbench"
  heading="Show your agent working, not just answering."
/>
```

## Interactive AI feature section on a product homepage

Pass your own domain scenarios to demonstrate real tool calls and grounded outputs, or wire `onApproveAction` to open a live sandbox.

```tsx
import { AgentShowcase } from "@/components/agent-showcase";

export function CopilotFeatureSection() {
  return (
    <section className="mx-auto max-w-[1280px] px-4 py-16">
      <AgentShowcase
        eyebrow="Autonomous ops"
        heading="Verified tool calls before anything touches production."
        onApproveAction={async ({ scenarioId, mode }) => {
          console.log("Approved sandbox run:", scenarioId, mode);
        }}
      />
    </section>
  );
}
```

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `eyebrow` | `string` | `"Agent workbench"` | Plain label above the section display heading. |
| `heading` | `string` | – | Primary display heading for the showcase section. |
| `subheading` | `string` | – | Supporting line inviting visitors to interact with tasks, tools and citations. |
| `scenarios` | `AgentScenario[]` | – | Three end-to-end tasks with prompts, tool calls, citations and receipt labels. |
| `onApproveAction` | `(payload: { scenarioId: string; mode: AgentMode }) => Promise<unknown> \| void` | – | Optional async callback invoked when the visitor approves the staged action. |
| `accent` | `string` | `"var(--primary)"` | CSS colour or theme token tinting the lit execution surface and active task marker. |

## States

- **arrival**: Renders the first task at its completed, grounded state so visitors immediately read the prompt, verified tools, citations and ready action.
- **scenario or replay**: Choosing another task or clicking Replay steps each tool through running -> emerald check sequentially while rolling latency and token metrics.
- **tool expand**: Clicking any tool row smoothly expands its structured output via grid-template-rows (0fr -> 1fr) and rotates the chevron.
- **citation inspect**: Selecting any numbered source pill updates the grounded excerpt immediately in place.
- **approve / undo**: Clicking the footer CTA confirms the action with an emerald check receipt and morphs the button to Undo via TextMorph.
- **reduced motion**: Skips step playback timers and switches tasks, outputs and receipts immediately in place.

## What it handles

Showing multi-step agent reasoning, tool verification, grounded citations and human-in-the-loop approval inside a responsive landing section usually turns into a fragile video or a cluttered mock window.

- **Selectable production scenarios**: Three realistic tasks in the left rail let visitors switch domains and watch tool runs execute live.
- **Fast vs Deep routing toggle**: Glides a solid grey indicator, rolls end-to-end latency and context tokens via NumberRoll and adjusts step pacing.
- **Expandable tool-call rows**: Each tool transitions through queued, running and verified check states, unfolding structured terminal output inline via CSS grid rows.
- **Grounded citation inspector**: Clicking any numbered source pill switches the evidence line beneath the summary with zero layout jump.
- **Approve & Undo receipt bar**: Calls your optional async onApproveAction callback and morphs the CTA cleanly between Approve and Undo.
- **First-paint clarity & reduced motion**: Opens at the finished state so strangers grasp the workflow within 3 seconds, and skips step timers under prefers-reduced-motion.

## Replaces

static product demo video, mock AI chat window, expandable tool-call log, interactive citation viewer

## Where it fits

- **AI developer tools & coding agents**: Demonstrates trace inspection, SQL index verification, secret rotation and schema checks live on the landing page.
- **AI finance & operations copilots**: Shows payout reconciliation, variance memos and churn triage with auditable citations and explicit human approval.
- **Enterprise AI product showcases**: Proves grounded tool execution and safe undo receipts instead of generic streaming text.
- **Interactive feature deep-dives**: Lets prospects replay a run, inspect real outputs and toggle Fast vs Deep routing in one section.

## Notes

- Zero animation libraries: uses CSS grid-template-rows folds, NumberRoll and TextMorph.
- All tabs, tool disclosures and radio controls carry full ARIA roles and keyboard access; buttons using TextMorph include explicit aria-labels.
- Respects prefers-reduced-motion and pauses playback timers when scrolled off screen.

License: Hairline UI commercial license, not MIT (https://hairlineui.com/license#blocks)
