Data list
Label and value pairs: the details of an order, a customer, a server. Labels line up in a column beside their values and stack above them when the list is narrow. For many records with the same fields use a table; for a single figure use the stat card.
Install
npx shadcn@latest add @thrum-pro/data-listThis is a Pro component. The command works once your project has a licence key: set up Pro or see pricing.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
DataList: orientation | "horizontal" | "vertical" | Default "horizontal" | horizontal puts each label in a column beside its value, and stacks them when the list is narrower than 384 pixels. vertical always puts the label above its value. |
DataList: labelWidth | string | Default "10rem" | The width of the label column in the horizontal layout, as any CSS length. Long labels wrap inside it. |
DataList: dividers | boolean | Default false | A 1 pixel rule between pairs, with 10 pixels above and below each. Without it the pairs are 12 pixels apart. |
DataList: framed | boolean | Default false | Put the list in a rounded bordered card panel that adapts to frosted glass. |
DataListItem | div props | – | One pair. A div is allowed inside a description list to group a term with its description. |
DataListLabel | dt props | – | The label, in the muted text colour. |
DataListValue: copyValue | string | – | Text for a copy button at the end of the value. Without it there is no button. |
DataListValue: copyLabel | string | Default "Copy" | The copy button's name for screen readers. Say what is copied: "Copy customer ID". |
className | string | – | On every part: extra classes, merged last. Set the list's width on DataList. |
Motion and sound
Motion
- The list does not move. The copy button's icon turns into a tick for 2 seconds after a copy.
Sound
- The copy button plays a short completion sound after a copy and a low one when the browser refuses.
Sound is off until the visitor turns it on. Pass sound={false} to keep this component silent. How sound works
Accessibility
- It is a description list: dl, with each pair a dt and a dd inside a div, so a screen reader announces the list, its number of items, and each label with its value.
- The copy button is named by copyLabel and says Copied in a live region after a copy.
- Values wrap anywhere, so a long URL or id never makes the list wider than its container. Nothing overflows at 160 pixels wide.
- The stacked layout is chosen by a container query on the list's own width, not the window's, so it works in a narrow sidebar on a wide screen.
| Keys | Action |
|---|---|
| Tab | Move between the copy buttons. Labels and values are not focusable. |
| Enter / Space | Copy the value of the focused button. |
Source
The source comes with Pro
TypeScript source · Copy-paste ready · MIT-compatible for client projects · Includes all dependencies
Files and dependencies
- Adds
components/ui/data-list.tsx- Packages
- None
- Brings along
- Copy button
Changelog
- 1.0.0 · 2026-12-03First release.