Components
- Accordion
- Action BarUpdated
- Alert Dialog
- Alert
- Announcement
- Aspect Ratio
- Autocomplete
- Avatar
- BadgeUpdated
- Bottom Navigation
- Breadcrumb
- Button Group
- Button
- CalendarUpdated
- CardUpdated
- Carousel
- Chart
- Checkbox
- Circular Progress
- Circular Slider
- Clipboard
- Collapsible
- Color Picker
- Combobox
- Command
- Context MenuUpdated
- Data List
- Date Picker
- DialogUpdated
- DrawerUpdated
- Editable
- FieldUpdated
- File Upload
- Float
- Floating Panel
- Frame
- Hint
- Hover Card
- Image Cropper
- Input Group
- Input OTP
- Input
- Item
- Kbd
- Link Overlay
- Listbox
- MarqueeUpdated
- Menu
- Native Select
- Number InputUpdated
- Pagination
- Popover
- Progress
- Prose
- QR Code
- Radio Group
- Rating
- Resizable
- Scroll Area
- Segment Group
- Select
- Separator
- Sheet
- Sidebar
- Signature Pad
- Skeleton
- Skip Nav
- Slider
- Spinner
- Status
- Steps
- Switch
- TableUpdated
- Tabs
- Textarea
- TimerUpdated
- ToastUpdated
- Toggle Group
- Toggle Tooltip
- Toggle
- Tooltip
- Tour
- Tree View
Hooks
Data List
A list of label-value pairs.
- New Users
- 234
- Sales
- £12,340
- Revenue
- 3,450
Installation#
pnpm dlx shadcn@latest add @shark/data-list
Anatomy#
DataList └── DataListItem ├── DataListItemLabel └── DataListItemValue
Usage#
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>john@example.com</DataListItemValue> </DataListItem> </DataList>
Orientation#
Use the orientation prop to change the orientation of the datalist component.
Horizontal#
- First Name
- Jassie
- Last Name
- Bhatia
- jassie@example.com
Vertical#
- First Name
- Jassie
- Last Name
- Bhatia
- jassie@example.com
Examples#
Info Tip#
- New Users
- 234
- Sales
- £12,340
- Revenue
- 3,450
Separator#
Use the divide-y utility class on DataList to add a separator between items.
- First Name
- Jassie
- Last Name
- Bhatia
- jassie@example.com
- Phone
- 1234567890
- Address
- 1234 Main St, Anytown, USA
API Reference#
DataList#
Root wrapper for label-value list layout.
| Prop | Type | Default |
|---|---|---|
orientation | "horizontal" | "vertical" | "horizontal" |
className | string | - |
asChild | boolean | false |
DataListItem#
Single label-value row.
| Prop | Type | Default |
|---|---|---|
className | string | - |
asChild | boolean | false |
DataListItemLabel#
Label or key for the row.
| Prop | Type | Default |
|---|---|---|
className | string | - |
asChild | boolean | false |
DataListItemValue#
Value or content for the row.
| Prop | Type | Default |
|---|---|---|
className | string | - |
asChild | boolean | false |