Componentdata0.74 KB gzipZero dependencies
Stat Tile
KPI metric box with big tabular numbers, delta change and sparkline bars.
Preview
Live Preview
Installation
Tokens guide →Add to your project via CLI (zero dependencies, code you own):
npx bigbullui add stat-tileOr install the full npm package:
npm install bigbulluiUsage
tsx3 lines
import { StatTile } from "@/components/ui/stat-tile"; <StatTile label="TOTAL ADMITTED" value="4,820" delta={{ value: "+18%", up: true }} />Source code
stat-tile.tsx + 2 helpersZero third-party dependencies (3 local files shown in tabs below).
tsxstat-tile.tsx58 lines
"use client"; import * as React from "react";import { cn } from "./lib/utils";import { TiltCard } from "./tilt-card"; export interface StatTileProps extends React.HTMLAttributes<HTMLDivElement> { label: string; value: string | number; delta?: { value: string; up: boolean }; spark?: number[];} /** Single statistic tile: large KPI metric + delta + spark bars. */export function StatTile({ label = "", value = "", delta, spark, className, ...props }: StatTileProps) { return ( <TiltCard maxTilt={4} glare={false} className={cn("p-4", className)} {...props}> <p className="font-mono text-[10px] uppercase tracking-[0.15em] text-muted-foreground">{label}</p>Props
Interactive Prop Playground
Tweak parsed AST props below to generate ready-to-paste JSX.
tsx3 lines
import { StatTile } from "@/components/ui/stat-tile"; <StatTile />| Prop | Type | Description |
|---|---|---|
| label | string | Stat tile label |
| value | string | number | Stat value number or string |
| delta | { value: string; up: boolean } | Delta change indicator |
| spark | number[] | Optional mini sparkline data array |