完整场景
数据卡片组
用数字做证明:数据卡片依次出现,每个数字在预留好的宽度内向上计数、不会挤动,最后下方出现一句总结。
安装
npx @imgcli/cli add stat-grid使用
import { StatGrid } from "@/components/imgcli/stat-grid";
<StatGrid
stats={[
{
"value": 128,
"label": "active projects"
},
{
"value": 24,
"label": "teams onboarded"
},
{
"value": 98,
"suffix": "%",
"label": "on-time delivery"
}
]}
line="A clearer view of your team's work."
/>;默认示例:展示项目管理示例数据:128 个活跃项目、24 个团队和 98% 的按时交付率。以 30 fps 渲染 120 帧(4.0 秒)。
| 参数 | 类型 | 默认值 | 说明 |
|---|---|---|---|
stats | readonly StatGridStat[] | 见使用示例 | |
line | string | "A clearer view of your team's work." | A closing line under the tiles. Empty for none. |
fontFamily | string | — | A face from the Imgcli font list, or any loaded CSS font stack. |
accentColor | string | — | |
theme | Partial<ImgcliTheme> | — | |
mode | "light" | "dark" | — | |
speed | number | 1 |
许可
MIT 许可,可免费用于个人及商业项目,保留版权和许可声明。
Copyright (c) 2026 Ricky (Imgcli) <https://imgcli.com>
常见问题
如何在 Remotion 项目中使用数据卡片组?
运行 npx @imgcli/cli add stat-grid。CLI 会把组件源码复制到项目的 components/imgcli/ 目录并安装依赖,之后可以直接修改源码。
数据卡片组能做什么?
用数字做证明:数据卡片依次出现,每个数字在预留好的宽度内向上计数、不会挤动,最后下方出现一句总结。
使用数据卡片组前需要准备什么?
准备 Node.js 20.19 或更高版本,以及一个 Remotion 项目。新项目可以用 npx create-video@latest 创建。免费组件采用 MIT 许可证。