Stat
KPI / metric card. 3 trends × 2 styles.
Revenue
৳4,82,300
+12.4%vs last week
import { Stat } from "@/components/ui/stat";
export default function Example() {
return (
<div style={{ width: 240, maxWidth: "100%" }}>
<Stat label="Revenue" value="৳4,82,300" delta="+12.4%" caption="vs last week" />
</div>
);
}
Installation
$ npx uix-ui@latest add statThis copies the file into components/ui/stat.tsx in your project. npx shadcn@latest add @uix/stat works too.
Usage
import { Stat } from "@/components/ui/stat";
<div style={{ width: 240, maxWidth: "100%" }}>
<Stat label="Revenue" value="৳4,82,300" delta="+12.4%" caption="vs last week" />
</div>
Props
| Prop | Type | Default | Description |
|---|---|---|---|
appearance | outlined | elevated | "outlined" | |
trend | up | down | neutral | "up" | |
label | React.ReactNode | – | |
value | React.ReactNode | – | |
delta | React.ReactNode | – | Change shown next to the value, for example +12.5%. |
caption | React.ReactNode | – |
Everything else is passed to the root element, so className, aria-* and event handlers work as usual.
Dependencies
Installed for you by the CLI.
class-variance-authorityclsxtailwind-merge
lib/utils.tscomponents/ui/icons.tsx