# Reasoning summary

The reasoning trail folded to its working line: the activity mark and what the agent is doing in words with a timer, then Worked for 14s with any retry kept on the line, opening to the full trail.

Tier: pro. Type: component. Category: ai. Tags: agent, streaming, motion.

## Install

```bash
npx shadcn@latest add @pixilui-pro/reasoning-summary
```

One-time setup: add the registry to `components.json`:

```json
{
  "registries": {
    "@pixilui": "https://pixilui.com/r/{name}.json",
    "@pixilui-pro": {
      "url": "https://pixilui.com/r/pro/{name}.json",
      "headers": { "Authorization": "Bearer ${PIXILUI_TOKEN}" }
    }
  }
}
```

Pro items need a license. Create a token on https://pixilui.com/account and set `PIXILUI_TOKEN` in `.env.local`; the CLI sends it as a bearer header.

Files: `components/pixilui/reasoning-summary.tsx`.

## Preview

Live preview: https://pixilui.com/components/reasoning-summary

Signature: Reading turns into Querying Snowflake letter by letter out of a soft blur while the mark's cells hand over from reading to fetching.

Styles: `lively` (default), `quiet`, set with `data-style` on <html>. The item reads the style through the foundation; it needs no prop.

## Code

Pro source is available to license holders.

## Usage

When to use:

- A chat answer whose reasoning should stay out of the way: one line while it works, one click to the steps.
- Past messages in a thread: status done with the steps, settled.

When not to use:

- When the steps should show as they happen: use the reasoning trail open (head working).
- No steps at all: use thinking state (free).

```tsx
import { useReasoningTrailSimulation } from "@/components/pixilui/reasoning-trail";
import { ReasoningSummary } from "@/components/pixilui/reasoning-summary";

// One finished element: the run plays by itself.
export const knobs = {} as const;

/** A chat turn: the summary line plays the run, names each action with its mark, and folds into Worked for. */
export default function ReasoningSummaryDemo() {
  const run = useReasoningTrailSimulation();
  return (
    // a centered column, as the lock sets the question and the line
    <div className="mx-auto flex w-full max-w-xl flex-col gap-4 rounded-panel bg-surface p-6 elevation-raised">
      <p className="self-end rounded-control bg-surface-muted px-3 py-2 type-label text-foreground">Did the new onboarding help retention?</p>
      <ReasoningSummary status={run.status} words={run.words} mark={run.mark} flag={run.flag} steps={run.steps} />
      {run.answering ? <p className="type-body text-foreground">Yes, more than the dashboard shows: 38% to 46% without the launch signups.</p> : null}
    </div>
  );
}
```

## Examples

None.

## API

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `mark` | `ThinkingMarkState` |  | The activity mark leading the line. Defaults to the live step's kind (think: thinking, query: fetching, read: reading). |

## Keyboard

- `Enter` + `Space`: On the line: opens or folds the steps.

## Accessibility

- The line is a button with aria-expanded; its words are role status, so each action is announced politely.
- The mark is aria-hidden; the words carry the meaning. Retries and failures are words.

## Motion

- Each new action's words come in letter by letter out of a soft blur while the old ones lift away; the mark hands over from the centre at the same time.
- The live words carry the text shimmer; the timer counts whole seconds. When the answer starts the mark draws its tick and the line reads Worked for.
- Opening shows the trail's steps with the fold; reduced motion makes every change instant.

## Responsive

- One line, as wide as its words; opened, the steps fill the column.

## Performance

- The reasoning trail, folded: CSS in the foundation for the look; one canvas for the mark.

## Notes for AI

- <ReasoningSummary status="live" steps={steps} /> names the live step's title and picks its mark from the step's kind; pass words and mark to say something else.
- status="done" with flag="1 retry" once the answer starts; thinkingStateFromChat maps the AI SDK's chat status.
- Everything ReasoningTrail takes works here (labels, seconds, startedAt, settled, open, onOpenChange).
- Per-style rule: none.

## Related

- [Reasoning trail](https://pixilui.com/components/reasoning-trail/markdown): The agent's thinking chain in a chat: steps on one hairline with their thoughts and sources, streamed with a soft edge, folding into one line when the answer starts, any retry or failure kept.
- [Thinking state](https://pixilui.com/components/thinking-state/markdown): The working line: what the agent is doing in words, led by the activity mark, with a timer; when the answer starts it reads Worked for 14s, keeps anything that went wrong on the line, and folds.
- [Activity mark](https://pixilui.com/components/thinking-mark/markdown): What an agent is doing right now, acted out on a 5 by 5 grid at 16px or larger: a radar sweep while it searches, a reading head through text, a question mark when it needs you. 36 activities.
