Gráficos e métricas
VBarList
Lista de barras horizontais rotuladas para rankings e distribuições ("Why claims get denied", "How fast money moves"). Cada barra é um `role="meter"` acessível (`aria-valuemin/max/now` e `aria-valuetext`); o VProgress interno fica `aria-hidden`.
<script setup lang="ts">
import { VBarList } from 'vueui-nova-kit'
</script>Uso
<VBarList :items="[{ label: 'Missing docs', value: 38 }]" unit="%" />Playground
Os controles abaixo são gerados a partir das props declaradas em VBarList.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 (inline, destaca o maior).
Ver código
<script setup lang="ts">
import { VBarList } from 'vueui-nova-kit'
const items = [
{ label: 'Missing documentation', value: 38 },
{ label: 'Incorrect part number', value: 21 },
{ label: 'Late submission', value: 17 },
{ label: 'Warranty expired', value: 13 },
{ label: 'Other', value: 11 },
]
</script>
<template>
<VBarList :items="items" unit="%" aria-label="Why claims get denied" />
</template>Stacked
Variação Empilhada com display customizado e um item forçado em destaque.
Ver código
<script setup lang="ts">
import { VBarList } from 'vueui-nova-kit'
const items = [
{
label: 'Detected to prepared',
value: 3.4,
display: '3.4 days',
},
{
label: 'Prepared to submitted',
value: 2.1,
display: '2.1 days',
},
{
label: 'Submitted to decision',
value: 12.6,
display: '12.6 days',
emphasized: true,
},
{
label: 'Approved to paid',
value: 6.3,
display: '6.3 days',
},
]
</script>
<template>
<VBarList
:items="items"
layout="stacked"
emphasis="none"
aria-label="How fast money moves" />
</template>With Hints
Variação Com hint sob o rótulo e cores por item.
Ver código
<script setup lang="ts">
import { VBarList } from 'vueui-nova-kit'
const items = [
{
label: 'Paid',
hint: '36 claims',
value: 51300,
display: '$51,300',
color: 'var(--v-color-primary)',
},
{
label: 'In flight',
hint: '25 collecting evidence',
value: 79760,
display: '$79,760',
color: 'var(--v-color-primary-300)',
},
{
label: 'Lost',
hint: '23 not eligible',
value: 51340,
display: '$51,340',
color: 'var(--v-color-neutral-300)',
},
]
</script>
<template>
<VBarList
:items="items"
emphasis="none"
aria-label="Why claims get denied" />
</template>Small
Variação Compacta. Props: size="sm", emphasis="first".
Ver código
<script setup lang="ts">
import { VBarList } from 'vueui-nova-kit'
const items = [
{ label: 'Missing documentation', value: 38 },
{ label: 'Incorrect part number', value: 21 },
{ label: 'Late submission', value: 17 },
{ label: 'Warranty expired', value: 13 },
{ label: 'Other', value: 11 },
]
</script>
<template>
<VBarList
:items="items"
unit="%"
emphasis="first"
size="sm"
aria-label="Why claims get denied" />
</template>Props
| Prop | Tipo | Default | Descrição |
|---|---|---|---|
items | VBarListItem[] | — | — |
max | number | — | Scale maximum. Defaults to the largest value. |
unit | string | — | Suffix appended to values without `display` (e.g. `%`, ` days`). |
layout | VBarListLayout | "inline" | — |
emphasis | VBarListEmphasis | "max" | — |
size | VBarListSize | "md" | — |
showValue | boolean | true | — |
ariaLabel | string | — | — |
dataTestId | string | — | — |
Events
Não emite eventos.
Slots
| Slot | Props do slot |
|---|---|
#label | item |
#value | item |
Fonte: src/components/data/VBarList/VBarList.vue · tipos: src/components/data/VBarList/VBarList.types.ts