Gráficos e métricas
VStatCard
Cartão de KPI: rótulo, valor em destaque, variação com tendência e métricas secundárias. Slots: `header-trailing` (ex.: seletor de período), `value-trailing`, default (gráfico) e `footer`.
<script setup lang="ts">
import { VStatCard } from 'vueui-nova-kit'
</script>Uso
<VStatCard label="Recovered this month" value="$84,620" delta="14.8%" delta-caption="vs $73,710 in August" />Playground
Os controles abaixo são gerados a partir das props declaradas em VStatCard.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. Use a aba Controls para experimentar as props ao vivo.
Ver código
<script setup lang="ts">
import { VStatCard } from 'vueui-nova-kit'
</script>
<template>
<VStatCard
label="Runs on this edge"
value="1,842"
caption="Last 24 hours" />
</template>With Delta
Variação Com variação. Props: delta="14.8%", delta-caption.
Ver código
<script setup lang="ts">
import { VStatCard } from 'vueui-nova-kit'
</script>
<template>
<VStatCard
label="Recovered this month"
value="$84,620"
delta="14.8%"
delta-caption="vs $73,710 in August" />
</template>Negative Delta
Variação Queda. Delta negativo infere trend="down".
Ver código
<script setup lang="ts">
import { VStatCard } from 'vueui-nova-kit'
</script>
<template>
<VStatCard
label="Success rate"
value="82.2%"
delta="-3.1%"
delta-caption="vs last week" />
</template>Kpi Row
Variação Linha de KPIs (página Evidence): variant="plain" separados por divisores.
Ver código
<script setup lang="ts">
import { VStatCard, VBadge } from 'vueui-nova-kit'
</script>
<template>
<div style="display:grid;grid-template-columns:repeat(4,1fr);gap:24px;max-width:860px;">
<VStatCard variant="plain" label="Open" value="7" caption="$10,240 in claims" />
<VStatCard variant="plain" label="Overdue" value="2" caption="$5,120 in claims">
<template #value-trailing><VBadge size="sm" variant="danger" dot>Nudge today</VBadge></template>
</VStatCard>
<VStatCard variant="plain" label="Answered in" value="1.4 days" caption="Average, last 30 days" />
<VStatCard variant="plain" label="Answered" value="94%" caption="Last 30 days" />
</div>
</template>Edge Health Grid
Variação Grade 2×2 (Edge health): size="sm", variant="tinted".
Ver código
<script setup lang="ts">
import { VStatCard } from 'vueui-nova-kit'
</script>
<template>
<div style="display:grid;grid-template-columns:repeat(2,1fr);gap:8px;max-width:360px;">
<VStatCard size="sm" variant="tinted" label="Runs on this edge" value="1,842" />
<VStatCard size="sm" variant="tinted" label="Success rate" value="82.2%" />
<VStatCard size="sm" variant="tinted" label="Avg latency" value="190 ms" />
<VStatCard size="sm" variant="tinted" label="Context complete" value="1,714" />
</div>
</template>Hero With Stats
Variação Hero (Clawback): size="lg", variant="elevated", icon, seletor em #header-trailing e stats com pontos coloridos.
Ver código
<script setup lang="ts">
import { VStatCard, VButton } from 'vueui-nova-kit'
const walletIcon = {
width: 24,
height: 24,
body: '<path fill=\'none\' stroke=\'currentColor\' stroke-linecap=\'round\' stroke-linejoin=\'round\' stroke-width=\'2\' d=\'M5 3L15 3C16.6569 3 18 4.3431 18 6L18 7C19.6569 7 21 8.3431 21 10L21 18C21 19.6569 19.6569 21 18 21L6 21C4.3431 21 3 19.6569 3 18L3 5C3 3.8954 3.8954 3 5 3ZM3 5C3 6.1046 3.8954 7 5 7L18 7M21 12L18 12C16.8954 12 16 12.8954 16 14C16 15.1046 16.8954 16 18 16L21 16\'/>'
}
const stats = [
{
label: 'Pending',
value: '$31.2K',
caption: '22 claims',
color: 'var(--v-color-info-base)'
},
{
label: 'At risk',
value: '$12.4K',
caption: '5 claims',
color: 'var(--v-color-warning-base)'
},
{
label: 'Denied',
value: '$8.7K',
caption: '7 claims',
color: 'var(--v-color-error-base)'
}
]
</script>
<template>
<div style="max-width:420px;">
<VStatCard size="lg" variant="elevated" :icon="walletIcon" label="Recovered this month" value="$84,620"
delta="14.8%" delta-caption="vs $73,710 in August" :stats="stats">
<template #header-trailing><VButton size="sm" variant="secondary">September</VButton></template>
</VStatCard>
</div>
</template>With Chart
Variação Com gráfico no slot default: VBarChart dentro do cartão.
Ver código
<script setup lang="ts">
import { VStatCard, VBarChart } from 'vueui-nova-kit'
const data = [
{
label: 'Jan',
value: 20
},
{
label: 'Feb',
value: 34
},
{
label: 'Mar',
value: 48
},
{
label: 'Apr',
value: 44
},
{
label: 'May',
value: 58
},
{
label: 'Jun',
value: 72
},
{
label: 'Jul',
value: 68
},
{
label: 'Aug',
value: 82
},
{
label: 'Sep',
value: 96
}
]
</script>
<template>
<div style="max-width:420px;">
<VStatCard label="Recovered in 2026" value="$428,650" caption="212 claims paid · 78% recovery rate">
<VBarChart :data="data" :height="96" />
</VStatCard>
</div>
</template>Loading
Variação Carregando. Props: loading, loading-label (nome acessível do skeleton; padrão Loading, traduza no seu app).
Ver código
<script setup lang="ts">
import { VStatCard } from 'vueui-nova-kit'
</script>
<template>
<VStatCard
label="Runs on this edge"
value="1,842"
caption="Last 24 hours"
loading
loading-label="Carregando métricas" />
</template>Props
| Prop | Tipo | Default | Descrição |
|---|---|---|---|
label | string | — | — |
value | string | number | — | — |
caption | string | — | Muted line under the value (e.g. "Average, last 30 days"). |
delta | string | number | — | Delta pill content, e.g. `14.8%` or `-3`. Trend is inferred from the sign when `trend` is omitted. |
trend | VStatCardTrend | — | — |
deltaCaption | string | — | Text after the delta pill (e.g. "vs $73,710 in August"). |
icon | IconifyIcon | — | — |
stats | VStatCardStat[] | — | Secondary metrics rendered in a row below a divider. |
size | VStatCardSize | "md" | — |
variant | VStatCardVariant | "outlined" | — |
loading | boolean | false | — |
loadingLabel | string | — | Accessible name of the loading skeleton (screen readers). Default: `Loading`. |
dataTestId | string | — | — |
Events
Não emite eventos.
Slots
| Slot | Props do slot |
|---|---|
#label | — |
#header-trailing | — |
#value | — |
#value-trailing | — |
#default | — |
#footer | — |
Fonte: src/components/data/VStatCard/VStatCard.vue · tipos: src/components/data/VStatCard/VStatCard.types.ts