Skip to content
Mosaic
On this page

DataList

Label and value pairs for read-only detail, as a dl of dt and dd, so assistive technology reads each value with its label.

Use for

  • read-only details such as the fields of a device or payment method
  • a list of label and value pairs
  • session or account metadata

Practices

GuidancePractice
DoWrap each pair in DataList.Item.
DoPass divided={false} when the pairs are few enough to scan as a block.
Don’tPut long text in DataList.Value. It truncates to one line.

API reference

DataList.Root

The dl. Carries data-divided.

Slot: cl-data-list

PropTypeDescription
dividedbooleanDraws rules between the items.Default: true

DataList.Item

One pair, as a div.

Slot: cl-data-list-item

DataList.Label

The dt.

Slot: cl-data-list-label

DataList.Value

The dd. Truncates to one line.

Slot: cl-data-list-value

Examples

Device details

TSX
<DataList.Root>
  <DataList.Item>
    <DataList.Label>{m.ipAddress}</DataList.Label>
    <DataList.Value>{session.ipAddress}</DataList.Value>
  </DataList.Item>
</DataList.Root>