Display

Stat

A labelled number for dashboards, with an optional delta, trend arrow and description line.

Monthly recurring revenue
$48,200 +12%

vs. last month

Copy
<template>
  <JStat label="Monthly recurring revenue" value="$48,200" delta="+12%" trend="up" description="vs. last month" />
</template>

Installation #

With the Nuxt module, every component is auto-imported — there is nothing to add. In a plain Vue project, import what you use:

Copy
import { JStat } from '@juxtui/ui'

Usage #

Copy
<JStat label="Monthly recurring revenue" value="$48,200" delta="+12%" trend="up" description="vs. last month" />

delta is display text, not a number — format it yourself ("+12%", "-3", "0"), trend only decides the colour and arrow.

Without trend, a delta still renders, just in a neutral colour with no arrow.

Variants & examples #

In a grid#

Three stats side by side, each with its own trend.

Active users
2,481 +8.2%
Churn
1.4% +0.3%
Support tickets
62 0%
Copy
<template>
  <div class="grid grid-cols-1 gap-6 sm:grid-cols-3">
    <JStat label="Active users" value="2,481" delta="+8.2%" trend="up" />
    <JStat label="Churn" value="1.4%" delta="+0.3%" trend="down" />
    <JStat label="Support tickets" value="62" delta="0%" trend="neutral" />
  </div>
</template>

With an icon#

Balance
$1,204.50

Next charge on Oct 1

Copy
<script setup lang="ts">
import { CreditCard } from '@lucide/vue'
</script>

<template>
  <JStat label="Balance" value="$1,204.50" description="Next charge on Oct 1">
    <template #icon><CreditCard /></template>
  </JStat>
</template>

API #

Props

PropTypeDefault Description
labelstring—What the number measures.
valuestring | number—The headline number.
deltastring—Change shown next to the value, e.g. "+12%".
trend'up' | 'down' | 'neutral'—Colours delta and adds an arrow icon (none for neutral).
descriptionstring—Supporting line under the value.

Slots

SlotProps Description
icon—Small icon shown next to the label.

Accessibility #

  • Renders as plain text — there’s no live region, so a stat that updates in place should be wrapped in your own aria-live region if the change matters to announce.
  • Trend colour is reinforced by the arrow icon, not colour alone.