IndexRow
A numbered record with optional evidence, linked title, and active state.
Install
npx shadcn@latest add @jbm/index-rowNeeds the @jbm entry in components.json; see Install once.
Also installs @jbm/tokens, @jbm/action-link.
Usage
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" />Props
- Stage
fluidWidth 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.
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" >.
QA checks
- 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.