Component
Stat
A stable readout for dashboards and compact summary bands.
Preview
Balance$8,742
Pace$64
Over$18
Installation
Install the package, then import the component and shared stylesheet in your app.
Package install
Install the package when you want components imported from axie-ui.
install
pnpm add axie-uiImport
code
import "axie-ui/styles.css";import { Stat } from "axie-ui";Registry install
Use the direct URL when you want shadcn to copy editable source into your app. This works without the official registry and does not install axie-ui.
registry
pnpm dlx shadcn@latest add https://axie.alexi.life/r/stat.jsonCopied source import
code
import "@/styles/axie.css";import { Stat } from "@/components/axie/stat";Prefer @axie/stat? Add the Axie namespace once from the Installation page, then use that shorthand.
Usage
code
import { Stat } from "axie-ui";export function Example() { return <Stat label="Pace" tone="accent" value="$64" />;}Accessibility
- Pair numbers with labels that explain the unit or measure.
- Use tabular numbers for changing values.
- Do not use color alone to signal positive or negative movement.
API Reference
| Prop | Type | Default | Description |
|---|---|---|---|
| label | string | - | Stat label. |
| value | string | - | Stat value. |
| tone | neutral | accent | danger | neutral | Controls value color. |