Dados e tabelas

VDescriptionList

Componente4 exemplos8 propsA2UI · DescriptionList

Lista de descrição (`<dl>`) para metadados e detalhamentos com total. Slots `value-{key}` ou `value` permitem badges/links no valor.

Importação
<script setup lang="ts">
import { VDescriptionList } from 'vueui-nova-kit'
</script>

Uso

Exemplo
<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
vue
<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
vue
<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
vue
<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
vue
<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

PropTipoDefaultDescrição
itemsVDescriptionItem[]——
layoutVDescriptionListLayout"inline"—
sizeVDescriptionListSize"md"—
dividersbooleanfalseHairline between rows.
total{ label: string; value: string | number }
{ label: string; value: string | number; }
—Emphasized summary row rendered after the items (e.g. "Claimed · $1,840").
columnsnumber2Grid layout column count.
ariaLabelstring——
dataTestIdstring——

Events

Não emite eventos.

Slots

SlotProps do slot
#[`value-${row.key}`]item
#valueitem

Fonte: src/components/data/VDescriptionList/VDescriptionList.vue · tipos: src/components/data/VDescriptionList/VDescriptionList.types.ts