Skip to content
Thrum

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-list

This is a Pro component. The command works once your project has a licence key: set up Pro or see pricing.

Props

PropTypeDefaultDescription
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: labelWidthstringDefault "10rem"The width of the label column in the horizontal layout, as any CSS length. Long labels wrap inside it.
DataList: dividersbooleanDefault falseA 1 pixel rule between pairs, with 10 pixels above and below each. Without it the pairs are 12 pixels apart.
DataList: framedbooleanDefault falsePut the list in a rounded bordered card panel that adapts to frosted glass.
DataListItemdiv props–One pair. A div is allowed inside a description list to group a term with its description.
DataListLabeldt props–The label, in the muted text colour.
DataListValue: copyValuestring–Text for a copy button at the end of the value. Without it there is no button.
DataListValue: copyLabelstringDefault "Copy"The copy button's name for screen readers. Say what is copied: "Copy customer ID".
classNamestring–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.
KeysAction
TabMove between the copy buttons. Labels and values are not focusable.
Enter / SpaceCopy the value of the focused button.

Source

SourcePro

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. 1.0.0 · 2026-12-03First release.

Loading index…

Keyboard shortcuts

/Ctrl KSearch components, docs and actions
?Show this list
AAppearance studio
SSound on or off
MFull or reduced motion
TTheme: auto, light, dark
GSurface: solid or frosted
BBackdrop photograph (under glass)
CCorner radius: square to round
RReplay the demo, on a component page
DDraw new data, on a component page
←→HomeEndMove the cursor in a focused chart
EscClose a dialog, or leave a chart cursor