Componentdata0.74 KB gzipZero dependencies

Stat Tile

KPI metric box with big tabular numbers, delta change and sparkline bars.

Preview

Live Preview
Open ↗

Installation

Tokens guide →

Add to your project via CLI (zero dependencies, code you own):

npx bigbullui add stat-tile

Or install the full npm package:

npm install bigbullui

Usage

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 helpers

Zero 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 />
PropTypeDescription
labelstringStat tile label
valuestring | numberStat value number or string
delta{ value: string; up: boolean }Delta change indicator
sparknumber[]Optional mini sparkline data array