Dados e tabelas
VDescriptionList
Lista de descrição (`<dl>`) para metadados e detalhamentos com total. Slots `value-{key}` ou `value` permitem badges/links no valor.
<script setup lang="ts">
import { VDescriptionList } from 'vueui-nova-kit'
</script>Uso
<VDescriptionList :items="items" :total="{ label: 'Claimed', value: '$1,840' }" dividers />Playground
Os controles abaixo são gerados a partir das props declaradas em VDescriptionList.types.ts; o código acompanha cada mudança.
Exemplos
Variantes, tamanhos e estados, extraídos das stories da biblioteca.
Default
Variação Padrão (bloco Submission).
Ver código
<script setup lang="ts">
import { VDescriptionList } from 'vueui-nova-kit'
const items = [
{ label: 'Confirmation', value: 'CW-7730418' },
{ label: 'Submitted by', value: 'Nizam, today 9:14 AM' },
{ label: 'Portal account', value: 'Carrier dealer 4471' },
]
</script>
<template>
<VDescriptionList :items="items" size="sm" />
</template>Breakdown With Total
Variação Detalhamento com total (Recovery breakdown): hint, dividers, total.
Ver código
<script setup lang="ts">
import { VDescriptionList } from 'vueui-nova-kit'
const items = [
{
label: 'Replacement compressor',
hint: 'Part credit · 10-year parts warranty',
value: '$1,140',
},
{
label: 'Labor',
hint: '4.5 h at $88 · extended labor plan',
value: '$396',
},
{
label: 'Refrigerant R-410A',
hint: '6 lb recovered and recharged',
value: '$186',
},
{
label: 'Diagnostic allowance',
hint: 'Flat rate',
value: '$65',
},
{ label: 'Freight', hint: 'Part shipping', value: '$53' },
]
const total = { label: 'Claimed', value: '$1,840' }
</script>
<template>
<VDescriptionList :items="items" dividers :total="total" />
</template>Grid
Variação Grade com slot de valor customizado.
Ver código
<script setup lang="ts">
import { VDescriptionList, VBadge } from 'vueui-nova-kit'
const args = {
items: [
{
key: 'status',
label: 'Status',
value: 'Submitted'
},
{
key: 'owner',
label: 'Owner',
value: 'Marcus Reed'
},
{
key: 'serial',
label: 'Serial',
value: '3819A44218'
}
],
layout: 'grid',
size: 'sm',
dividers: false,
columns: 3
}
</script>
<template>
<VDescriptionList v-bind="args">
<template #value-status="{ item }"><VBadge size="sm" variant="primary" dot>{{ item.value }}</VBadge></template>
</VDescriptionList>
</template>Stacked
Variação Empilhada.
Ver código
<script setup lang="ts">
import { VDescriptionList } from 'vueui-nova-kit'
const items = [
{ label: 'Confirmation', value: 'CW-7730418' },
{ label: 'Submitted by', value: 'Nizam, today 9:14 AM' },
{ label: 'Portal account', value: 'Carrier dealer 4471' },
]
</script>
<template>
<VDescriptionList :items="items" layout="stacked" size="sm" />
</template>Props
| Prop | Tipo | Default | Descrição |
|---|---|---|---|
items | VDescriptionItem[] | — | — |
layout | VDescriptionListLayout | "inline" | — |
size | VDescriptionListSize | "md" | — |
dividers | boolean | false | Hairline between rows. |
total | { label: string; value: string | number } | — | Emphasized summary row rendered after the items (e.g. "Claimed · $1,840"). |
columns | number | 2 | Grid layout column count. |
ariaLabel | string | — | — |
dataTestId | string | — | — |
Events
Não emite eventos.
Slots
| Slot | Props do slot |
|---|---|
#[`value-${row.key}`] | item |
#value | item |
Fonte: src/components/data/VDescriptionList/VDescriptionList.vue · tipos: src/components/data/VDescriptionList/VDescriptionList.types.ts