Menu

Stat

KPI / metric card. 3 trends × 2 styles.

Revenue

৳4,82,300

+12.4%

vs last week

Installation

$ npx uix-ui@latest add stat

This copies the file into components/ui/stat.tsx in your project. npx shadcn@latest add @uix/stat works too.

Usage

stat.tsx
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

PropTypeDefaultDescription
appearanceoutlined | elevated"outlined"
trendup | down | neutral"up"
labelReact.ReactNode–
valueReact.ReactNode–
deltaReact.ReactNode–Change shown next to the value, for example +12.5%.
captionReact.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-authority
  • clsx
  • tailwind-merge
  • lib/utils.ts
  • components/ui/icons.tsx
esc

↑↓ to navigate · ↵ to select · esc to close