jbmui

IndexRow

  • UI

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

01
Primero, el contexto.
Una pregunta clara antes de abrir otra pestaña.
02
Después, la evidencia.
Datos, ejemplos y decisiones que se pueden revisar.
03
Al final, una idea útil.

Install

npx shadcn@latest add @jbm/index-row

Needs the @jbm entry in components.json; see Install once.

Also installs @jbm/tokens, @jbm/action-link.

Usage

Numbered index with an active row
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
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.

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.

PropTypeDefaultDescription
indexReact.ReactNoderequiredThe row marker, such as "01"; Geist Mono 14px, dim or vermilion when active.
titleReact.ReactNoderequiredThe record's title, 22px. Rendered through ActionLink (with its arrow) when href is set.
evidenceReact.ReactNodenoneOptional supporting text below the title, 15px dim; may contain links or other nodes.
hrefstringnoneLinks the title. Without it the title is plain text.
activebooleanfalseMarks 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.