Overview
Reference usage
Semantic dl/dt/dd list for term–description pairs such as metadata or attributes.
Usage
The default variant draws only a hairline between rows, with no fill or frame, so its rows start on the content's leading edge, the same edge as the heading above the list. A row with an href still draws its hover tint and focus ring from 12px before the term, so the tint never starts at the first glyph. The striped, narrow, grid, facts and fields variants keep their own insets.
The two-column variant sets a muted term on the left and the value on the right, with no row dividers and no inset at the start of a row, so the term sits on the text edge of what surrounds the list. The term column is at most about 10rem wide; below 28rem of the list's own width each term stacks above its value, close to it.
Metadata for a record
DescriptionList is how a record shows its label and value metadata: an owner, a created date, a price. Do not draw those pairs as a row of Badge or Chip pills; pills are for a status or a short tag. The two-column, fields and facts variants set the label and the value side by side, so labels line up down the page and the values read as text. For a few typed facts that each take an icon and a value, such as a kind, a neighbourhood and a price band, use KeyFacts.
Pairs that fit their space
The grid variant lays the pairs out in as many equal columns as the list's own width fits, about 6.5rem each (--cinder-space-24 plus --cinder-space-2), with each muted term above its value at the column's start edge. The columns come from the list's inline size, never the viewport, so the same list reads three short pairs on one row in a wide card, two on a phone card and one in a narrow column. It draws no rules and no fill. An item with wide: true takes the whole row: give it to a value that would wrap past about two lines in a column, runs over several lines, or is code. wide works in the facts variant too. Reading order is the order of items.
A note under a value
Give an item a note for a muted second line under its definition: what the value is called elsewhere, such as a check read in words with its name and version beneath (Contains phrase, then contains-phrase, version 1). The note is plain text, read with the definition, and is left out when empty. Use it instead of a second row that states the same fact twice. An identifier at the note's start goes in noteCode, drawn in the mono family at the note's size: { term: 'Workflow', definition: 'Chat with an agent', noteCode: 'agentRun', note: '(built in)' } reads agentRun (built in) under the name.
A long tag in a tags definition is shortened with an ellipsis and keeps its whole text as its title, so it never runs out of its row.
A row that leads somewhere
Give an item an href when its value names something with a page of its own, such as the person who owns a record. The row ends in a quiet trailing chevron, the record-details affordance InspectorRow draws, and the whole row is the link's target; a control in the row, such as an identifier's copy button, stays clickable on its own. A row without an href draws no chevron, so read-only facts never look like links. The link is named for the term and, when the value is plain text, the value.
Formatted values
A definition can be a value the list formats, so every list shows timestamps, IDs and tags the same way:
{ type: 'timestamp', value }: a readable date and time, with the exact time (full date, seconds and zone) on hover.{ type: 'identifier', value }: an ID or hash, shortened and set in small monospace, with an icon-only copy button that copies the whole value.{ type: 'tags', tags, systemTagCount, onAddTag }: read-only tags, with system tags counted instead of listed and an Add a tag action that callsonAddTag.{ type: 'code', value }: text in the code font, shown whole and broken anywhere, such as a command or a value written as JSON.{ type: 'empty', label }: a field that holds nothing, written as a quiet word such as "None", so it never reads as a typed value.
- Component
- DescriptionList
- Status
- Stable
- Version
- 1.0.0
- License
- MIT
- Maintainer
- Cinder team
When to use
- Summarizing the properties of one record such as a user profile or order detail.
- Switching between stacked and inline term layouts via the variant prop.
- Iterating over a homogenous collection of records — use data-list or table instead.
Examples
Description list
Key–value metadata pairs in the default stacked layout.
Description list formatted values
A shortened ID with a copy button, a timestamp with the exact time on hover, and read-only tags with an Add a tag action.
Description list rich definitions
Definitions can render rich snippet content when plain text is not enough.
Description list variants
Striped and two-column layout variants.
Props
Name | Type | Default | Description |
|---|---|---|---|
items required | DescriptionListItem[] | ||
variant | 'default''striped''two-column''narrow''facts''fields''grid' | 'default' | Controls the visual layout:
- default: stacked rows with visible terms.
- striped: alternating row backgrounds.
- two-column: a muted term on the left and the value on the right, with no row dividers;
collapses to stacked at narrow widths.
- narrow: <dt> is visually hidden via .cinder-sr-only. Only appropriate when
surrounding context already labels the value. NOT a general compact mode.
- fields: a record read as a list: a regular-weight muted term in a fixed 140px column, its value
beside it, each row at least 44px tall flat, with a quiet rule under each (framed adds a tinted group,
raised while the list is narrower than 700px); a row with an href ends in a trailing chevron; the term stacks above its value
while the list is narrower than 23rem (368px).
- facts: one row of equal columns, each a muted term above its value, between two quiet
rules (the queues, tasks, workflow and version of a worker); wraps to more rows as the
container narrows.
- grid: the pairs flow in as many equal columns as the list's own width fits (about 6.5rem
each), each a muted term above its value at the column's start edge, with no rules and no
fill: a wide card reads three short pairs on one row, a phone two, a narrow column one. A
wide item takes the whole row. |
stack | boolean | false | Puts every term above its value at any width. The two-column variant
already stacks once its own container is narrower than 28rem; stack
stacks it regardless, for a list whose page has already chosen its phone
layout. Has no effect on narrow, whose terms stay visually hidden. |
framed | boolean | false | Keeps the tinted, rounded frame around the fields variant. The variant is flat by default, so
a record inside a pane or a card never draws a box inside a box; set this where the list stands
alone on the page canvas. While the list is narrower than 700px of its own width the frame takes
the raised fill of a grouped list, as an Inspector's group does below 700px of its own. Has no
effect on any other variant. |
actions | snippet | Optional snippet rendered once per row. Receives the full DescriptionListItem so
consumers can build disambiguated aria-label strings (e.g. aria-label="Edit ${item.term}").
Any interactive element in actions MUST set an unambiguous aria-label. |