Skip to content

Stat ​

vue
<script setup lang="ts">
import { Stat } from '@/components/kuro/stat';
</script>

<template>
  <Stat trend="up">
    <template #icon>📈</template>
    <template #label>Revenue</template>
    <template #value>$12,345</template>
    <template #trendValue>+5%</template>
  </Stat>
</template>

Installation ​

bash
npx kuro-ui add stat
bash
npx github:Bartek-Nowak/Kuro add stat

Variants ​

The Stat component supports a trend variant to visually indicate the trend direction.

VariantDescription
upPositive trend, shown in green
downNegative trend, shown in red
neutralNeutral/no trend, shown in gray

Props ​

PropTypeDescription
trendstring (optional)Trend direction variant: up, down, or neutral
classstring (optional)Additional CSS classes

Slots ​

SlotDescription
icon(optional) Icon or emoji displayed before the label
labelLabel or description of the statistic
valueThe main statistic value to display
trendValue(optional) Value describing the trend, e.g. "+5%", "-3"

Usage Example ​

vue
<template>
  <Stat trend="up">
    <template #icon>📈</template>
    <template #label>Revenue</template>
    <template #value>$12,345</template>
    <template #trendValue>+5%</template>
  </Stat>
</template>