docs/components/data-list
Sections
Components
Utilities
Forms
Hooks
Copy Markdown
A list of label-value pairs.
PreviewCode
New Users234
Sales£12,340
Revenue3,450
CLIManual
pnpmbunnpmyarn
pnpm dlx shadcn@latest add @shark/data-list
DataList
└── DataListItem
├── DataListItemLabel
└── DataListItemValue
import {
DataList,
DataListItem,
DataListItemLabel,
DataListItemValue,
} from "@/components/ui/data-list";
<DataList>
<DataListItem>
<DataListItemLabel>Name</DataListItemLabel>
<DataListItemValue>John Doe</DataListItemValue>
</DataListItem>
<DataListItem>
<DataListItemLabel>Email</DataListItemLabel>
<DataListItemValue>[email protected]</DataListItemValue>
</DataListItem>
</DataList>
Use the orientation prop to change the orientation of the datalist component.
PreviewCode
First NameJassie
Last NameBhatia
PreviewCode
First NameJassie
Last NameBhatia
PreviewCode
New Users234
Sales£12,340
Revenue3,450
Use the divide-y utility class on DataList to add a separator between items.
PreviewCode
First NameJassie
Last NameBhatia
Phone1234567890
Address1234 Main St, Anytown, USA
Root wrapper for label-value list layout.
| Prop | Type | Default |
|---|---|---|
orientation | `"horizontal" | "vertical"` |
className | string | - |
asChild | boolean | false |
Single label-value row.
| Prop | Type | Default |
|---|---|---|
className | string | - |
asChild | boolean | false |
Label or key for the row.
| Prop | Type | Default |
|---|---|---|
className | string | - |
asChild | boolean | false |
Value or content for the row.
| Prop | Type | Default |
|---|---|---|
className | string | - |
asChild | boolean | false |
[
Previous page
Context Menu ](/docs/components/context-menu)[
Next page
Date Input ](/docs/components/date-input)
On This Page
InstallationAnatomyUsageOrientationHorizontalVerticalExamplesInfo TipSeparatorAPI ReferenceDataListDataListItemDataListItemLabelDataListItemValue