- Docs
- Components
- 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
// 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.
| Prop | Type | Default | What it does |
|---|---|---|---|
layout | "rows" | "columns" | "rows" | Rows: the term beside its value. Columns: the term above, in up to columns columns. |
columns | 1 | 2 | 3 | 4 | 2 | In columns: the most, fewer where there isn't room (at least 8rem each). |
DescriptionItem: term | ReactNode | required | What the value is: "Email". |
DescriptionItem: children | ReactNode | — | The value. Empty shows "—", read as "Not set". |
DescriptionItem: description · action | ReactNode | — | A sentence under the value, and an action at the row's end: a Settings row. |
DescriptionItem: messages | object | the provider's | The "Not set" string. |
03
Parts
Each part carries a data-slot, for tests and placement.
| data-slot | Element | What it is |
|---|---|---|
description-list | <dl> | data-layout. |
description-item | <div> | One pair. |
description-term | <dt> | The term. |
description-value | <dd> | The value. |