Skip to main content
  1. Docs
  2. Components
  3. Data display

Description list

Facts about one record, as terms and values: each pair read together, every detail page lined up the same way.

Import
@qeetrix/react/experimental
Status
ExperimentalSince 0.0.6
Renders
<dl>Server-rendered
Tested
WCAG 2.2 AAaxe on every pull request

01

Import

description-list.tsx
// Experimental: from the package's experimental entry, until it's stable.
import { DescriptionList, DescriptionItem } from "@qeetrix/react/experimental";

02

Props

And every native attribute of the element it renders.

PropTypeDefaultWhat it does
layout"rows" | "columns""rows"Rows: the term beside its value. Columns: the term above, in up to columns columns.
columns1 | 2 | 3 | 42In columns: the most, fewer where there isn't room (at least 8rem each).
DescriptionItem: termReactNoderequiredWhat the value is: "Email".
DescriptionItem: childrenReactNode—The value. Empty shows "—", read as "Not set".
DescriptionItem: description · actionReactNode—A sentence under the value, and an action at the row's end: a Settings row.
DescriptionItem: messagesobjectthe provider'sThe "Not set" string.

03

Parts

Each part carries a data-slot, for tests and placement.

data-slotElementWhat it is
description-list<dl>data-layout.
description-item<div>One pair.
description-term<dt>The term.
description-value<dd>The value.

04

With a copy button

An ID or a key and its CopyButton, side by side in the value.

key-details.tsx
<DescriptionItem term="Key ID">
  <Text mono>kid_8f2c1a9b</Text>
  <CopyButton value="kid_8f2c1a9b" label="Copy key ID" size="sm" />
</DescriptionItem>
Next — Description listAccessibility