WlDescriptions
Appearance
Use the value slot to put a status or link beside its term. Long values wrap as the column becomes narrower.
- Customer
- Studio North
- Order reference
- ORD-2026-000184
- Status
- Confirmed
Full example
<WlDescriptions :items="items" >
<template #value="{ item }">
<WlPill v-if="item.key === 'state'" tone="success" :label="String(item.value)" />
<template v-else>{{ item.value }}</template>
</template>
<template #empty>
<WlEmpty title="No order details yet" />
</template>
</WlDescriptions>Example data
- Customer
- Studio North
- Order reference
- ORD-2026-000184
- Status
- Confirmed
Full example
<WlDescriptions :items="items" >
<template #value="{ item }">
<WlPill v-if="item.key === 'state'" tone="success" :label="String(item.value)" />
<template v-else>{{ item.value }}</template>
</template>
<template #empty>
<WlEmpty title="No order details yet" />
</template>
</WlDescriptions>Order details with a copy action
Use the value slot to place a copy button beside the order reference and show a status badge.
- Order reference
ORD-2026-000184- Delivery address
- Studio North, 24 River Street, 3rd floor
- Status
- Confirmed
Full example
<script setup lang="ts">
import { WlCopyButton, WlDescriptions, WlPill } from "legato-ui";
import { computed } from "vue";
const details = computed(() => [
{ key: "reference", label: "Order reference", value: "ORD-2026-000184" },
{ key: "delivery", label: "Delivery address", value: "Studio North, 24 River Street, 3rd floor" },
{ key: "state", label: "Status", value: "Confirmed" }
]);
</script>
<template>
<WlDescriptions :items="details" :columns="2">
<template #value="{ item }">
<div v-if="item.key === 'reference'" class="wl-inline" data-space="xs">
<code>{{ item.value }}</code>
<WlCopyButton
:text="String(item.value)"
aria-label="Copy order reference"
size="xs"
variant="ghost"
icon-only
/>
</div>
<WlPill v-else-if="item.key === 'state'" tone="success" :label="String(item.value)" />
<template v-else>{{ item.value }}</template>
</template>
</WlDescriptions>
</template>Props
Types, accepted values and literal defaults come from the public manifest. Inherited settings name their source; “Not set” means no default is declared.
| Prop | Type / values | Default | Purpose |
|---|---|---|---|
items * | readonly WlDescriptionItem[] | Required | Ordered label and value pairs. |
columns | 1 | | 2 | Maximum number of columns when the container has enough room. |
pt | WlPt< | Not set | Attributes for the description list, items, terms and values. |
Events
No public events.
Slots
| Slot | Type / values | Content |
|---|---|---|
value | value?(props: { item: WlDescriptionItem }): unknown; | Customize the value for a specific item. |
empty | empty?(): unknown; | Content to show when there are no items. |
Pass-through: pt
Sections WlDescriptions are listed below. Attributes merge in this order: createWlPt() WlConfig.ptpt instance. Class and style merge; the last supplied value takes priority for other attributes.
| Section | DOM | Purpose |
|---|---|---|
root | dl.wl-descriptions | Main element of the component. |
item | div.wl-descriptions__item | One repeated item. |
term | dt.wl-descriptions__term | Term in the description list. |
value | dd.wl-descriptions__value | Value in the description list. |
Sections refer to the component DOM. Dotted names identify a configuration group and its section; composite parts use their own pt groups. Global and local attributes merge, with class and style added together.
Keyboard and accessibility
- Use the value slot to put a status or link beside its term. Long values wrap as the column becomes narrower.
- Use a short, descriptive term for each value. The component renders native definition-list semantics.
- Include text for important status values when the value slot also uses color or an icon.
Keyboard and application responsibilities
Provide a meaningful accessible name and connect labels, hints and errors to the focusable element. Check the behavior with your own data and a screen reader.
WAI-ARIA Authoring PracticesIn your application, check keyboard controls, zoom and focus visibility. State labels and required information must be readable in every theme.