---
title: "Data List"
description: "Shows the details of one record as label and value pairs, such as an order or a person. It stacks the pairs by itself in a narrow box."
url: https://gelatinui.com/components/data-list
markdown_url: https://gelatinui.com/components/data-list.md
access: free
install: "npx shadcn@latest add @gelatin-ui/data-list"
registry_item: https://gelatinui.com/r/data-list.json
version: "2026-11-08"
index: https://gelatinui.com/llms.txt
docs_index: https://gelatinui.com/docs/llms.txt
---

# Data List

> Shows the details of one record as label and value pairs, such as an order or a person. It stacks the pairs by itself in a narrow box.

Page: https://gelatinui.com/components/data-list

## When to use it

Best for: The details of one record as label and value pairs: an order, a person, or an invoice.

- Use it for the details of one record: an order, a person, an invoice.
- Use `vertical` in side panels and for long labels. A horizontal list stacks by itself in a box under 384px wide.
- Use `leader` for a spec list with numbers that end on one edge. Add `divider` for long lists and for values that wrap.

## When not to use it

- To compare many records in rows and columns, use a table.

## Notes for agents

- A horizontal list stacks by itself in a box under 384px wide: no breakpoint classes are needed.
- Use `leader` for numbers that end on one edge, and `divider` for long lists.

## Anatomy

```text
DataList
├─ DataListItem (0..n)
├─ DataListLabel (0..n)
└─ DataListValue (0..n)
```

## API reference

### DataList

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `divider` | `boolean` | false |  |
| `leader` | `boolean` | false |  |
| `orientation` | `"horizontal" \| "vertical"` | "horizontal" |  |

### DataListItem

No props of its own: `className`, `children`, and every other prop go to the element it renders.

### DataListLabel

No props of its own: `className`, `children`, and every other prop go to the element it renders.

### DataListValue

No props of its own: `className`, `children`, and every other prop go to the element it renders.

## Styling

| Part | Slot | States | CSS variables | Tokens |
| --- | --- | --- | --- | --- |
| DataList | `data-list` |  |  |  |
| DataListItem | `data-list-item` |  |  |  |
| DataListLabel | `data-list-label` |  |  |  |
| DataListValue | `data-list-value` |  |  |  |

## Usage

Put one `DataListLabel` and one `DataListValue` in each `DataListItem`. For numbers, add `text-end tabular-nums` to the value, so the digits line up.

The sample also uses `badge`, which this add does not write. One command adds them with this item:

```bash
npx shadcn@latest add @gelatin-ui/data-list @gelatin-ui/badge
```

```tsx title="invoice-summary.tsx"
import { Badge } from "@/components/ui/badge";
import { DataList, DataListItem, DataListLabel, DataListValue } from "@/components/ui/data-list";

type Invoice = { number: string; customer: string; total: string; paid: boolean };

export function InvoiceSummary({ invoice }: { invoice: Invoice }) {
  return (
    <DataList divider>
      <DataListItem>
        <DataListLabel>Invoice</DataListLabel>
        <DataListValue className="font-mono">{invoice.number}</DataListValue>
      </DataListItem>
      <DataListItem>
        <DataListLabel>Customer</DataListLabel>
        <DataListValue>{invoice.customer}</DataListValue>
      </DataListItem>
      <DataListItem>
        <DataListLabel>Status</DataListLabel>
        <DataListValue>
          <Badge variant={invoice.paid ? "secondary" : "destructive"}>{invoice.paid ? "Paid" : "Due"}</Badge>
        </DataListValue>
      </DataListItem>
      <DataListItem>
        <DataListLabel>Total</DataListLabel>
        <DataListValue className="text-end tabular-nums">{invoice.total}</DataListValue>
      </DataListItem>
    </DataList>
  );
}
```

## Compose

Build it with:

- [Workspace](https://gelatinui.com/components/workspace.md): Holds the app shell: the sidebar and the page.
- [Frame](https://gelatinui.com/components/frame.md): Groups a row of numbers or a summary.
- [Count Up](https://gelatinui.com/components/count-up.md): Shows a key number that changes.
- [Badge](https://gelatinui.com/components/badge.md): Shows a level or a status next to a number.
- [Timeline](https://gelatinui.com/components/timeline.md): Shows the recent activity.

Rules:

- Depth from layers (`layered-neutrals`): Show depth with one step of the neutral tokens (page, card, muted) or one soft shadow, not with many borders or strong shadows.
- Color has a job (`color-has-a-job`): Use color only for a status, the brand action, or data; keep the rest neutral, and show a level with a small mark (a dot, a tinted badge) before a big fill.
- Real content (`real-content`): Fill the UI with content of the real product (real names, amounts, dates, and states), never lorem text or "Item 1".
- Every state is designed (`every-state`): Give each view of data its loading, empty, and error states: a skeleton in the final layout, an `Empty` with an illustration and one next action, and an error that says what failed and how to retry.

Patterns: `gelatin://patterns/dashboard-overview`

## Add it

```bash
npx shadcn@latest add @gelatin-ui/data-list
```

It adds 1 registry items: 1 files, 180 lines, and the npm packages `tailwind-merge`, `tailwind-variants`.

## For AI agents

- Every item, one file: https://gelatinui.com/llms.txt
- MCP server (`search_items`, `get_item`, `get_install_plan`): https://gelatinui.com/mcp

## Related

- [Badge](https://gelatinui.com/components/badge.md)
- [Copy Button](https://gelatinui.com/components/copy-button.md)

## Accessibility

Data List is a native `<dl>`. Each `DataListItem` is a `<div>` with a `<dt>` label and a `<dd>` value, so a screen reader says each label with its value.

It is not interactive: no focus and no hover. A control in a value, such as a link or a CopyButton, keeps its own states.

For an empty value, show a dash or a short text, such as "Not set".

Right to left: the label column sits at the inline start, on the right. All sides are logical.
