Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Shadcn Data List for React and Tailwind

A list of label-value pairs.

New Users
234
Sales
£12,340
Revenue
3,450

Installation

bunx --bun shadcn@latest add https://kit.dev/r/data-list.json

Usage

import {
  DataList,
  DataListItem,
  DataListItemLabel,
  DataListItemValue,
} from "@/components/ui/data-list";
const data = [
  { label: "New Users", value: "234" },
  { label: "Sales", value: "£12,340" },
  { label: "Revenue", value: "3,450" },
];

const DataListDemo = () => (
  <DataList>
    {data.map((item) => (
      <DataListItem key={item.label}>
        <DataListItemLabel>{item.label}</DataListItemLabel>
        <DataListItemValue>{item.value}</DataListItemValue>
      </DataListItem>
    ))}
  </DataList>
);

Demos

Info Tip

Orientation Horizontal

Orientation Vertical

Separator

With Badge

API Reference

DataList

dl

PropType
AttributeType

DataListItem

div

PropType
AttributeType

DataListItemLabel

dt

PropType
AttributeType

DataListItemValue

dd

PropType
AttributeType