Data Display & Media
Description List
Pairs of terms and values, such as the details of a policy, a claim or a customer.
Preview
Section titled “Preview”<nana-description-list layout="inline" columns="2" divided style="width: 100%">
<nana-description-item term="Policy number">
MTR-2026-00412
</nana-description-item>
<nana-description-item term="Status">
<nana-badge variant="success" dot>Active</nana-badge>
</nana-description-item>
<nana-description-item term="Policyholder">
Wanjiru Kamau
</nana-description-item>
<nana-description-item term="Cover">
Comprehensive motor
</nana-description-item>
<nana-description-item term="Annual premium">
KES 48,600
</nana-description-item>
<nana-description-item term="Renews">14 March 2027</nana-description-item>
<nana-description-item term="Vehicle" wide>
Toyota Probox, KDA 482Q
</nana-description-item>
</nana-description-list> - Policy number
- MTR-2026-00412
- Status
- Active
- Policyholder
- Wanjiru Kamau
- Cover
- Comprehensive motor
- Annual premium
- KES 48,600
- Renews
- 14 March 2027
- Vehicle
- Toyota Probox, KDA 482Q
<script lang="ts">
import { NanaDescriptionItem, NanaDescriptionList } from '$lib/components/ui/description-list';
import { NanaBadge } from '$lib/components/ui/badge';
</script>
<NanaDescriptionList layout="inline" columns={2} divided class="w-full">
<NanaDescriptionItem term="Policy number">MTR-2026-00412</NanaDescriptionItem>
<NanaDescriptionItem term="Status">
<NanaBadge variant="success" dot>Active</NanaBadge>
</NanaDescriptionItem>
<NanaDescriptionItem term="Policyholder">Wanjiru Kamau</NanaDescriptionItem>
<NanaDescriptionItem term="Cover">Comprehensive motor</NanaDescriptionItem>
<NanaDescriptionItem term="Annual premium">KES 48,600</NanaDescriptionItem>
<NanaDescriptionItem term="Renews">14 March 2027</NanaDescriptionItem>
<NanaDescriptionItem term="Vehicle" wide>Toyota Probox, KDA 482Q</NanaDescriptionItem>
</NanaDescriptionList> Installation
Section titled “Installation”Install the package for a versioned dependency:
npm install @nana-tec/ui-componentsOr copy the source in and own it:
npx @nana-tec/ui add description-list --framework web-componentsnpx @nana-tec/ui add description-list --framework svelteLands in src/lib/components/ui/description-list/, styled with Tailwind classes that resolve
to the design tokens. Requires Tailwind v4.
Import
Section titled “Import”
Import the autoloader once, in your app's entry point. Every <nana-*> tag then works anywhere, and
each component downloads only the first time a page uses it:
import "@nana-tec/ui-components/autoloader";import "@nana-tec/ui-components/theme";The second line gives every component the Nana look and the design tokens behind it. Leave it out to style the components entirely yourself.
Import a component directly when it must be ready at once: on screen at first paint, or when you call its methods straight away. The two mix freely:
import "@nana-tec/ui-components/description-list";
Copied in with npx @nana-tec/ui add description-list? Import your project's own
@/lib/nana-ui/autoloader.js once instead; the CLI keeps it up to date.
<script lang="ts"> import { NanaDescriptionList, NanaDescriptionItem } from '$lib/components/ui/description-list';</script>
<NanaDescriptionList> <NanaDescriptionItem term="Policy number">MTR-2026-00412</NanaDescriptionItem> <NanaDescriptionItem term="Premium">KES 48,600</NanaDescriptionItem></NanaDescriptionList>Layout
Section titled “Layout”layout="stacked", the default, puts each term above its value, which suits narrow panels
and cards. layout="inline" puts the term beside its value from 640px wide and stacks them
below that, which suits detail pages.
columns flows the items into two or three columns on wider screens. Set wide on an item
to give a long value, such as an address or notes, a row of its own. divided draws a line
under each item.
Rich terms and values
Section titled “Rich terms and values”A value can hold anything: a badge, a link, a formatted number. A term is text by default.
For a richer term, put it in the term slot.
<nana-description-item> <span slot="term">Excess <nana-tooltip content="Paid by you on each claim">?</nana-tooltip></span> KES 15,000</nana-description-item>For a richer term, pass a snippet.
<NanaDescriptionItem> {#snippet term()}Excess <abbr title="Paid by you on each claim">?</abbr>{/snippet} KES 15,000</NanaDescriptionItem>Accessibility
Section titled “Accessibility”The list is a native <dl>, each item a <div> holding a <dt> and a <dd>, so screen
readers announce how many items there are and pair each term with its value.
A native <dl> cannot reach across shadow roots, so the list takes the list role, each
item listitem, and inside it the term and value take the term and definition roles.
Screen readers announce how many items there are and read each term with its value.
Give the list an aria-label when there are several on one page, such as “Policy” and
“Vehicle”.
Properties
| Property | Attribute | Type | Default | Description |
|---|---|---|---|---|
columns | columns | DescriptionColumns | 1 | How many columns the items flow into on wider screens: 1, 2 or 3. |
divided | divided | boolean | false | Draws a line under each item. |
layout | layout | DescriptionLayout | 'stacked' | stacked puts each term above its value; inline puts them side by side from 640px wide. |
Slots
| Slot | Description |
|---|---|
(default) | The nana-description-item elements |
CSS custom properties
| Property | Description |
|---|---|
--nana-description-column-gap | Space between columns |
--nana-description-row-gap | Space between rows when there are no dividers |
Properties
| Property | Attribute | Type | Default | Description |
|---|---|---|---|---|
divided | divided | boolean | false | Set by the list it sits in. |
layout | layout | DescriptionLayout | 'stacked' | Set by the list it sits in. |
term | term | string | '' | The term. Use the term slot for anything richer than text. |
wide | wide | boolean | false | Spans every column of the list, for long values such as an address. |
Slots
| Slot | Description |
|---|---|
(default) | The value |
term | The term, when it needs more than the term text |
CSS parts
| Part | Description |
|---|---|
::part(item) | The row around the term and value |
::part(term) | The term |
::part(details) | The value |
CSS custom properties
| Property | Description |
|---|---|
--nana-description-term-color | Term colour |
--nana-description-value-color | Value colour |
--nana-description-term-width | Widest the term column grows in the inline layout |
--nana-description-border | Divider colour in a divided list |
NanaDescriptionItem
| Prop | Type | Default |
|---|---|---|
term | string | Snippet | |
wide | boolean | false |
children | Snippet |
Also accepts Omit<HTMLAttributes<HTMLDivElement>, 'class'>.
NanaDescriptionList
| Prop | Type | Default |
|---|---|---|
layout | DescriptionLayout | 'stacked' |
columns | DescriptionColumns | 1 |
divided | boolean | false |
children | Snippet |
Also accepts Omit<HTMLAttributes<HTMLDListElement>, 'class'>.