Vitral 0.2.18
Dados

DescriptionList

Fatos sobre uma coisa como rótulos e valores — um pedido, um perfil — num <dl> de verdade, em colunas que se dobram em uma quando a lista é estreita.

Importação

main.ts
import { DescriptionList } from '@vitral/vue';

Colunas

As colunas respondem à largura da própria lista, não à da janela: num painel estreito elas se dobram em uma.

Profile
Full name
Ana Souza
Role
Product designer
Email
ana@example.com
Phone
—
About
Leads the design system and the research behind the checkout.
<script setup lang="ts">import { DescriptionList } from '@vitral/vue'; const items = [    { label: 'Full name', value: 'Ana Souza' },    { label: 'Role', value: 'Product designer' },    { label: 'Email', value: 'ana@example.com' },    { label: 'Phone', value: null },    { label: 'About', value: 'Leads the design system and the research behind the checkout.', span: 2 }];</script> <template>    <DescriptionList title="Profile" :items="items" :columns="2" style="width: 100%" /></template>

Com bordas

Cada fato numa célula de um bloco só, com um valor desenhado por um slot e uma ação ao lado do título.

Order details
Order
#1042
Status
Shipped
Placed
14 Sep 2026
Total
$ 318.00
Ship to
Rua das Flores 120, São Paulo
<script setup lang="ts">import { Button, DescriptionList, Tag } from '@vitral/vue'; const items = [    { key: 'order', label: 'Order', value: '#1042' },    { key: 'status', label: 'Status', value: 'Shipped' },    { key: 'placed', label: 'Placed', value: '14 Sep 2026' },    { key: 'total', label: 'Total', value: '$ 318.00' },    { key: 'address', label: 'Ship to', value: 'Rua das Flores 120, São Paulo', span: 2 }];</script> <template>    <DescriptionList title="Order details" :items="items" :columns="2" bordered style="width: 100%">        <template #extra><Button label="Edit" icon="pencil" size="small" variant="outlined" severity="secondary" /></template>        <template #value="{ item }">            <Tag v-if="item.key === 'status'" :value="String(item.value)" severity="success" />            <template v-else>{{ item.value }}</template>        </template>    </DescriptionList></template>

Rótulo ao lado do valor

Plan
Team, billed yearly
Seats
12 of 15 used
Renews
1 March 2027
Payment
Visa ending 4242
<script setup lang="ts">import { DescriptionList } from '@vitral/vue'; const items = [    { label: 'Plan', value: 'Team, billed yearly' },    { label: 'Seats', value: '12 of 15 used' },    { label: 'Renews', value: '1 March 2027' },    { label: 'Payment', value: 'Visa ending 4242' }];</script> <template>    <DescriptionList :items="items" layout="horizontal" label-width="7rem" striped style="width: min(100%, 32rem)" /></template>

API

Lido de packages/vue/src/components/DescriptionList/types.ts, então diz o que o componente aceita de fato.

Props

NomeTipoDescrição
items DescriptionListItem[]—
title string—
columns numberLado a lado numa lista larga; elas se dobram em uma quando a lista é estreita. O padrão é 1.
layout 'vertical' | 'horizontal'Rótulo acima do valor (o padrão), ou ao lado dele.
bordered booleanCada item numa célula de um bloco só, com bordas.
striped boolean—
size Size—
emptyValue stringMostrado para um item sem valor. O padrão é um travessão.
labelWidth stringA largura dos rótulos no layout horizontal.
headingLevel 1 | 2 | 3 | 4 | 5 | 6Faz do título um cabeçalho deste nível.

Mais pt, dt e unstyled de BaseProps; veja pass-through e modo sem estilo.

Slots

NomeProps do slotDescrição
title ——
extra —Ao lado do título: um botão de editar.
label (context: { item: DescriptionListItem; index: number })—
value (context: { item: DescriptionListItem; index: number })—