# IndexRow (index-row)

> A numbered record with optional evidence, linked title, and active state.

- Entry: component
- Category: UI
- Preview capabilities: none (still preview)
- Runtime: React
- Needs Remotion: no
- QA page: https://jbm-ui.bns.studio/c/index-row
- JSON: https://jbm-ui.bns.studio/catalog/index-row.json
- Registry item: https://jbm-ui.bns.studio/r/index-row.json (source code in files[].content)

## Install

```sh
npx shadcn@latest add @jbm/index-row
```

Also installs @jbm/tokens, @jbm/action-link (registry dependencies install automatically).

## Required setup

1. Add the `@jbm` registry to components.json (keep any entries already there):

   ```json
   {
     "registries": {
       "@jbm": "https://jbm-ui.bns.studio/r/{name}.json"
     }
   }
   ```

2. Map `@/*` to `./src/*` in tsconfig.json `compilerOptions.paths`, so `@/jbm/…` imports resolve to src/jbm/.

## Files

Each file's source code is in the registry item JSON (https://jbm-ui.bns.studio/r/index-row.json, files[].content).

| Source path | Installs to | Import |
| --- | --- | --- |
| `registry/jbm/ui/index-row.tsx` | `src/jbm/ui/index-row.tsx` | `@/jbm/ui/index-row` |

## API

### `IndexRow` (component)

One row of a numbered index: a mono index, a 22px title (an ActionLink when `href` is set, otherwise bold text), and optional dim evidence below, with a hairline bottom border. Only the title is linked so evidence may contain its own links. Other div attributes pass through.

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `index` | `React.ReactNode` | required | The row marker, such as "01"; Geist Mono 14px, dim or vermilion when active. |
| `title` | `React.ReactNode` | required | The record's title, 22px. Rendered through ActionLink (with its arrow) when `href` is set. |
| `evidence` | `React.ReactNode` | none | Optional supporting text below the title, 15px dim; may contain links or other nodes. |
| `href` | `string` | none | Links the title. Without it the title is plain text. |
| `active` | `boolean` | `false` | Marks the current row: index and title turn vermilion, and a linked title gets aria-current="step". |

Also accepts Omit< React.HTMLAttributes<HTMLDivElement>, "title" >.

## Stage

fluid: Width fills the container. Height is 22px padding above and below plus the title (22px × 1.25–1.4 per line) and, when present, 8px + evidence lines at 15px × 1.55, plus the 1px bottom border. Long titles and evidence wrap and add lines.

## Examples

### Numbered index with an active row

```tsx
import { IndexRow } from "@/jbm/ui/index-row"

<IndexRow index="01" title="El contexto" evidence="Empieza con una pregunta." href="/contexto" active />
<IndexRow index="02" title="La evidencia" href="/evidencia" />
<IndexRow index="03" title="Una idea útil" />
```

## QA

- Compare active, linked, and unlinked rows: only the active row uses vermilion, linked titles show the ActionLink underline and arrow, and plain titles are bold ink.
- Hover and Tab to linked titles; the focus indicator is visible and aria-current="step" is present only on the active row.
- Check a narrow screen with long titles and evidence: text wraps beside the index, which stays baseline-aligned with the title's first line.

## Related

Installs:

- [Tokens (tokens)](https://jbm-ui.bns.studio/catalog/tokens.md)
- [ActionLink (action-link)](https://jbm-ui.bns.studio/catalog/action-link.md)

## More

- [llms.txt](https://jbm-ui.bns.studio/llms.txt): index of every item
- [catalog.json](https://jbm-ui.bns.studio/catalog.json): every item as JSON
- [Agent contract](https://jbm-ui.bns.studio/docs/agent-contract.md): what each field means
