Components
Stat
One figure on the page: the label whispers what it is, the value states it plainly in tabular figures, the delta reads the direction in the fixed semantic pigments.
#Basic usage
Letters received
12,480
↑ 4.2%Against last quarter
<script setup lang="ts">
import { Stat } from "@bysages/vue";
</script>
<template>
<Stat.Root>
<Stat.Label>Letters received</Stat.Label>
<Stat.Value>12,480</Stat.Value>
<Stat.Delta direction="up">↑ 4.2%</Stat.Delta>
<Stat.Description>Against last quarter</Stat.Description>
</Stat.Root>
</template>
#Props
#StatRoot
A styled part — no props of its own; it takes the anatomy's shared styling.
#StatLabel
A styled part — no props of its own; it takes the anatomy's shared styling.
#StatValue
A styled part — no props of its own; it takes the anatomy's shared styling.
#StatDescription
A styled part — no props of its own; it takes the anatomy's shared styling.
#StatDelta
The delta reads its direction from the direction prop (an explicit
data-direction attribute on the consumer side still wins).
| Prop | Type | Default | Description |
|---|---|---|---|
direction | String as PropType<"up" | "down" | "flat"> | "flat" | — |