Stat Card
solanaui/stat-cardFreeComponent
A card for displaying a single key metric with label, value, and optional trend badge.
Live preview
live · rendered by the registry
Rendered by solanaui on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://www.solanaui.dev/r/stat-card.jsonSource
1import type React from "react";2import { TrendBadge } from "@/registry/sol/trend-badge";3import { Card } from "@/components/ui/card";4import { cn } from "@/lib/utils";56interface StatCardProps extends React.ComponentProps<typeof Card> {7 label: string;8 value: string;9 change?: string;10 trend?: "up" | "down";11 icon?: React.ReactNode;12}1314const StatCard = ({15 label,16 value,17 change,18 trend = "up",19 icon,20 className,21 ...props22}: StatCardProps) => {23 return (24 <Card className={cn("p-4 gap-2", className)} {...props}>25 <div className="flex items-center justify-between">26 <span className="text-sm text-muted-foreground">{label}</span>27 {icon && <span className="text-muted-foreground">{icon}</span>}28 </div>29 <div className="flex items-end justify-between gap-2">30 <span className="text-2xl font-semibold tracking-tight">{value}</span>31 {change && <TrendBadge trend={trend}>{change}</TrendBadge>}32 </div>33 </Card>34 );35};3637export type { StatCardProps };38export { StatCard };
What it pulls in
Other registry items
Files it writes
More from solanaui
All 31 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Action Boxaction-box | solanaui | Components | Free | no deps | |
| Activity Feedactivity-feed | solanaui | Components | Free | 1 dep | |
| Address Displayaddress-display | solanaui | Components | Free | 1 dep | |
| Auth Cardauth-card | solanaui | Components | Free | no deps | |
| Health Barhealth-bar | solanaui | Components | Free | no deps | |
| Leverage Sliderleverage-slider | solanaui | Components | Free | no deps | |
| NFT Cardnft-card | solanaui | Components | Free | no deps | |
| Order Bookorder-book | solanaui | Components | Free | no deps |
