The label and value rows of a detail page, with real dl, dt and dd. Rows with a label column and hairlines, stacked, or a grid of two or three columns, reflowing to stacked on a phone by container queries. Values arrive in a short cascade, and a copy button copies its value and confirms on itself with a drawn check.
See it as an AI agent does.See this component the way an AI agent does.
Installation
npx shadcn@latest add @keyframery/description-listThis adds components/keyframery/description-list.tsx and its primitive to your project, and installs UI SDK. The motion tokens are added to your global CSS the first time you install a component.
Usage
import {
DescriptionList,
DescriptionListDetails,
DescriptionListItem,
DescriptionListTerm,
DescriptionListValue,
} from "@/components/keyframery/description-list"
export default function Usage() {
return (
<DescriptionList aria-label="Order">
<DescriptionListItem>
<DescriptionListTerm>Order</DescriptionListTerm>
<DescriptionListDetails>
<DescriptionListValue>#1048</DescriptionListValue>
</DescriptionListDetails>
</DescriptionListItem>
</DescriptionList>
)
}Anatomy
How the parts fit together:
DescriptionList
└── DescriptionListItem
├── DescriptionListTerm
└── DescriptionListDetails
└── DescriptionListValueExamples
An order's details, with copy buttons
A copy button copies the value beside it and confirms on itself with a drawn check. Below 28rem wide the rows stack.
A grid that truncates
layout="grid" with columns={3} lays items side by side, fewer columns when there is less room. truncate keeps long values on one line with the full text as a title.
Motion
| Move | What you see |
|---|---|
| Cascade | Items rise in one after another, 40ms apart, with a little blur, when the list first shows. |
| Press | The copy button sinks and springs back. |
| Draw | Copied, the copy icon shrinks into a blur, a check pops in and draws itself in green, and two seconds later they swap back. |
Timing and springiness follow the motion style you set. To change how fast this description list moves, pass speed:
<DescriptionList speed="fast">
…
</DescriptionList>"fast" is 0.6×, "slow" 1.4×, and a number sets the multiplier. With reduced motion turned on, nothing moves: changes happen at once or with a short fade.
Theming
Set these CSS variables on the component or a parent. Leave them unset to follow the light and dark theme. The open Customize panel below the preview lets you try these settings.
| Variable | What it changes | Default |
|---|---|---|
--description-list-term | The labels | --muted-foreground |
--description-list-ink | The values | --foreground |
--description-list-rule | Hairlines between rows | --border |
--description-list-label | The label column in rows | 10rem |
--description-list-gap | Space above and below an item | 0.75rem |
--description-list-font | The values' size | 13px |
API reference
Every part takes className and children, along with the props of the element it renders. The parts are rendered by UI SDK, so they also take render, to draw your own element, and a function of their state for className and style.
DescriptionList
Renders a <dlist>, and takes its props too.
Prop
Type
DescriptionListItem
Renders a <div>, and takes its props too.
Prop
Type
DescriptionListCopy
Renders a <button>, and takes its props too.
Prop
Type
Other parts
These take the props of the element they render, and nothing else:
DescriptionListTermDescriptionListDetailsDescriptionListValue: a<span>DescriptionListActions: a<span>
Keyboard
| Key | What it does |
|---|---|
| Tab | Moves to each copy button and action in the list. |
| Enter / Space | Copies the focused value; screen readers hear "Copied". |
Accessibility
Roles, keyboard and focus are declared on the component's UI SDK primitive, and state is announced through the matching ARIA attributes. More in Accessibility.
Built on UI SDK's core
UI SDK doesn't ship a description list, so this one is defined with its core: one definePrimitive in components/keyframery/core/description-list-core.ts, with no React in it. UI SDK's adapters can render that same definition in Vue, Svelte, Solid and web components. To keep your own styling and take only the motion, import from @/components/keyframery/primitives/description-list.
Questions
How does the animated Description list for UI SDK move?
Cascade: Items rise in one after another, 40ms apart, with a little blur, when the list first shows. Press: The copy button sinks and springs back. Draw: Copied, the copy icon shrinks into a blur, a check pops in and draws itself in green, and two seconds later they swap back.
Do I need Motion or Framer Motion for the animated Description list?
No. Every move is plain CSS, so there is nothing to install besides the component and UI SDK.
UI SDK has no description list. How is this one built on UI SDK?
Its behaviour is one definition written with UI SDK's core (definePrimitive), in components/keyframery/core/description-list-core.ts. Its parts are rendered by UI SDK's adapter, so they take render, state-based class names and data-slot, like every UI SDK component.
What happens to the Description list when someone turns on reduced motion?
Nothing moves. State changes happen at once, or with a short fade.