Description List
Terms and their details in a dl: stacked, inline (side by side, stacked again in a narrow container) or a grid of columns. Spacing from the role tokens, copyable details with an agent copy action, and a dash for an empty value that screen readers read as an overridable label.
Example
- Status
- Live
- Region
- eu-west-1
- Commit
- 9f2c4e1Copy
- Owner
- Not set
description-list-demo.tsxCopy code
Installation
Copy code
npm packages
class-variance-authority@0.7.1lucide-reactUsage
ImportCopy code
Reach for it for an entity's properties: a deployment's region and commit, a task's owner and dates. Pick inline for a panel, grid for a summary page.
API reference
DescriptionList
| Prop | Type | Default |
|---|---|---|
layout`stacked` (default): each term above its details. `inline`: side by side, stacked in a narrow container. `grid`: items in columns. | "stacked" | "inline" | "grid" | "stacked" |
columnsThe most columns `grid` uses; fewer while a column would get narrower than `--description-column-min` (12rem). | number | 3 |
labels | Partial<DescriptionListLabels> | – |
Also takes <dl> attributes and render.
DescriptionItem
Takes <div> attributes and render.
DescriptionTerm
Takes <dt> attributes and render.
DescriptionDetails
| Prop | Type | Default |
|---|---|---|
monoSets the value in the monospace face, for ids, hashes and keys. | boolean | false |
copyableAdds a copy button, and a `copy` action for agents named by the term. | boolean | false |
copyValueThe text to copy; defaults to the details when they are a string or a number. | string | – |
onCopy | DescriptionValueOptions["onCopy"] | – |
Also takes <dd> attributes and render.
Other exports
descriptionValuedescriptionListLabelstype DescriptionCopyDetailstype DescriptionValueOptionstype DescriptionDetailsPropstype DescriptionListLabelstype DescriptionListLayouttype DescriptionListPropsAccessibility
- A real dl: screen readers announce a list of terms with their definitions.
- An empty value shows a dash but reads a word (labels.empty), never silence.
- The copy button announces Copied in a polite live region.
Agent actions
Agents find a copyable value by its term and call copy.
Runs agent.snapshot() from @ui-sdk/react/agent on the live preview above.