Components
Description list
NativeLabel and value rows with optional copy actions for identifiers.
Deployment details
- Environment
- Production
- Region
- Singapore · ap-southeast-1
- Deployment
- deploy_8fe2c41
- Published by
- Amelia Chen
Installation
npx nook-ui@latest add description-listPrompt
Paste this into your AI coding assistant. It adds this exact component, the same way the CLI does, and tells the assistant how to use it.
Short. For assistants that can run commands in your project.
Add the Nook "Description list" component to this project, exactly as Nook ships it.
Label and value rows with optional copy actions for identifiers.
Steps
1. Check for `nook.json` in the project root. If it is missing, run `npx nook-ui@latest init` first (React or Next.js with Tailwind CSS v4). It adds the Nook tokens, the theme and `cn()`.
2. Run `npx nook-ui@latest add description-list`. It writes `components/ui/description-list.tsx` together with everything the component needs. Do not write the component from memory.
3. If you cannot run commands, fetch http://localhost:3000/r/description-list.json, write every entry of `files` to the path it names, install the packages in `dependencies`, and repeat for each name in `registryDependencies`.
4. Use it where I ask. Start from this example:
```tsx
import { DescriptionList } from "@/components/ui/description-list";
export default function Example() {
return (
<div className="@container w-full max-w-lg">
<h3 className="mb-5 text-base font-semibold">Deployment details</h3>
<DescriptionList
items={[
{ label: "Environment", value: "Production" },
{ label: "Region", value: "Singapore · ap-southeast-1" },
{
label: "Deployment",
value: "deploy_8fe2c41",
copyValue: "deploy_8fe2c41",
},
{ label: "Published by", value: "Amelia Chen" },
]}
/>
</div>
);
}
```
API
- `DescriptionList`: Label and value rows with optional copy actions for identifiers.
- `items` (`DescriptionItem[]`): Rows with a label, value and optional copyValue.
Rules
- Colors, radii, shadows and motion come from Nook tokens and classes such as `bg-primary`, `text-muted-foreground`, `border-border`, `rounded-lg` and `h-control`. Never hard-code them.
- Do not restyle or simplify the file. Change how it looks through `className`, its props and the theme.
- It must keep working with the keyboard, in light and dark mode, and in the sharp, soft and bold styles.
- Accessibility: Uses native dl, dt and dd; each copy action names its field.
Done when the component renders like the example in light and dark mode and the project type-checks.Usage
import { DescriptionList } from "@/components/ui/description-list";
export default function Example() {
return (
<div className="@container w-full max-w-lg">
<h3 className="mb-5 text-base font-semibold">Deployment details</h3>
<DescriptionList
items={[
{ label: "Environment", value: "Production" },
{ label: "Region", value: "Singapore · ap-southeast-1" },
{
label: "Deployment",
value: "deploy_8fe2c41",
copyValue: "deploy_8fe2c41",
},
{ label: "Published by", value: "Amelia Chen" },
]}
/>
</div>
);
}Examples
Profile
- Full name
- Priya Nair
- priya@northwind.example
- Role
- Editor
- Joined
- 14 February 2025
Rich values
- Status
- Paid
- Customer
- Northwind Ltd
- Tags
- RetainerEU
- Reference
- INV-1042
Long values
- Shipping address
- Rua das Flores 128, 3º Esq, 4050-262 Porto, Portugal
- Delivery notes
- Leave with the concierge between 9:00 and 18:00. Ring apartment 12 if nobody answers; the buzzer is on the left of the gate.
- Order ID
- ord_9f8e7d6c5b4a3210fedcba
Props
DescriptionList
Label and value rows with optional copy actions for identifiers.
| Prop | Type | Default | Description |
|---|---|---|---|
| items | DescriptionItem[] | – | Rows with a label, value and optional copyValue. |
Accessibility
Uses native dl, dt and dd; each copy action names its field.
Checked against WCAG 2.1 AA with automated axe tests and keyboard tests on every release.