DataList

Key-value pairs rendered as a description list

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

Variants

Sizes

Props

PropTypeDefaultDescription
items{ id?: string; label: ReactNode; value: ReactNode }[]The items to render.
orientation'horizontal' | 'vertical'horizontalLayout orientation of the component.
dividersbooleanfalseWhen true, shows dividers between items.
size'sm' | 'md'mdVisual size of the component (e.g. 'sm', 'md', 'lg').

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 with dividers

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

Related components

← Back to docs