# Trace outline

A row whose own outline is its progress bar: it traces round the row, laps it when the length is unknown, and closes green or stops red.

Also called: border progress, progress border, outline progress.

> chatcn Pro: needs a Pro license (https://chatcn.dev/pro). Install from the `@chatcn-pro` registry with your license token; setup at https://chatcn.dev/docs/chatcn-pro.

Example: Progress in the outline. A deploy on a loop: each row's outline is its progress, the build traces its percent, checks lap with no known length, and a timed out sync stops in red before the retry lands. Preview: https://chatcn.dev/preview/trace-outline-demo

A row that needs no bar and no badge. The trace leaves the middle of the row's left edge and runs clockwise round it as the work moves, following progress on a heavy spring, while the status sits at the end in plain words. Work with no known length gets a short trace that laps the row. Done closes the loop in green as the run check becomes a check; a failure stops the trace where it broke, in red.

## Installation

```bash
npx shadcn@latest add @chatcn-pro/trace-outline
```

## Usage

```tsx
import { TraceOutline } from "@/components/ui/chatcn/pro/trace-outline"

<TraceOutline status="running" progress={0.62}>
  <span>Build</span>
</TraceOutline>
<TraceOutline status="running" labels={{ running: "Checking" }}>
  <span>Checks</span>
</TraceOutline>
```

## Examples

### States

Example: Queued, running, done, failed. Four rows of an indexing job, each outline saying its state: dashed while queued, a trace at 62 percent, closed green, and stopped red. Preview: https://chatcn.dev/preview/trace-outline-states

## Props

| Prop | Type | Notes |
| --- | --- | --- |
| `status` | `"queued" | "running" | "done" | "error"` |  |
| `progress` | `number` | 0 to 1. Leave out for unknown length |
| `labels` | `Partial<Record<status, string>>` | Default Queued, Building, Live, Build failed |
| `children` | `ReactNode` | What the work is, on the left |

## Accessibility

- The status is a `role="status"`, with the label (and percent while running) as its text.
- Status colour always comes with the mark's shape and a word.

## Motion

- The outline is one SVG path with `pathLength` 100, so progress maps straight to `stroke-dasharray`.
- Labels edit in place with the Pro text morph, in a box reserved for the longest label, so nothing in the row moves.
- Reduced motion: the lap stands still and progress jumps.

Source: https://chatcn.dev/docs/components/trace-outline