DataList

Key-value pairs rendered as a description list

Category: display · WCAG 2.2-AA · key-value, description, metadata, details

Variants

Sizes

Props

PropTypeDefaultDescription
itemsDataListEntry[]The label/value pairs to render. Optional: pass `<DataListItem label="…">value</DataListItem>` children instead when a value needs surrounding JSX.
orientation'horizontal' | 'vertical'horizontalWhere each value sits relative to its own label: 'horizontal' beside it, 'vertical' underneath. Items are stacked vertically in both modes — this does not change the list's own axis.
dividersbooleanfalseWhen true, shows dividers between items.
size'sm' | 'md'mdVisual size of the component (e.g. 'sm', 'md', 'lg').
childrenReactNode`<DataListItem>` rows, as an alternative to `items`.

Design tokens

When to use

When not to use

How to build an accessible DataList in React →

Examples

Horizontal data list

<DataList
  items={[
    { label: 'Name', value: 'Ada Lovelace' },
    { label: 'Role', value: 'Mathematician' },
  ]}
/>

Vertical — value under its label, not "items stacked vertically"

Both modes stack the items vertically. `orientation` moves the VALUE: beside its label (horizontal) or under it (vertical).

<DataList
  orientation="vertical"
  items={[
    { label: 'Region', value: 'fra1' },
    { label: 'Branch', value: 'main' },
  ]}
/>

Vertical with dividers

<DataList
  orientation="vertical"
  dividers
  items={[{ label: 'Email', value: '[email protected]' }]}
/>

Related components

← Back to docs