总收入
$152,313.92
从上个月开始
16%订单总数
25,162
从上个月开始
20%新客户
3,847
从上个月开始
8.1%退款
$4,209.44
从上个月开始
2.4%CLI
手动安装
CLI 将组件源(及其内部依赖项)复制到您的项目中并安装任何所需的 npm 包。
npx boardui@latest add stat-cards使用共享 UI 包或自定义导入别名? 配置您的安装路径 在运行 CLI 之前。复制粘贴示例使用默认导入。
变体
两种外观通过 variant 属性。 plain (默认)是仪表盘模板中的紧凑卡 - 中性图标图块、标签、值和 Delta 标签。 页脚 标签旁边有一个有色渐变图标图块,将值设置为显示大小,然后将比较移动到带有白色 Delta 胶囊的页脚带,其字形如下 deltaColor.
<StatCards /> {/* compact: icon, label, value, delta chip */}<StatCards variant="footer" /> {/* icon tile + label, display value, footer band */}带上你自己的数据
通行证 stats 替换演示指标。页脚变体读取每个统计数据的三个额外可选字段: tone 为图标图块着色(蓝色、橙色、紫色、粉色、天空或翠绿色), caption 交换页脚文本,并且 hint 添加带有工具提示的信息字形。
import { RiCoinsFill, RiShoppingBasket2Fill } from "@remixicon/react";import { StatCards, type Stat } from "@/components/application/dashboard/stat-cards";
const stats: Stat[] = [ { icon: RiCoinsFill, label: "Total revenue", value: "$152,313.92", delta: "16%", deltaColor: "lime", // lime | rose | neutral - picks the pill glyph too tone: "blue", // icon tile tint (footer variant) caption: "From last month", // footer band caption (footer variant) hint: "Gross revenue across all channels.", // info tooltip (footer variant) }, { icon: RiShoppingBasket2Fill, label: "Total orders", value: "25,162", delta: "20%", deltaColor: "lime", tone: "orange", },];
<StatCards variant="footer" stats={stats} />