文字与标题
居中逐词成句
一句话逐词出现并始终保持居中:新词从右侧滑入,已出现的词向左让位。
安装
npx @imgcli/cli add centered-build使用
import { CenteredBuild } from "@/components/imgcli/centered-build";
<CenteredBuild />默认参数下以 30 fps 渲染 99 帧(3.3 秒),预览画布为 960 × 540。
Use <CenteredBuild text="Every launch deserves a film." accentWords={1} /> for centeredBuildSeconds(wordCount) seconds at 30 fps (99 frames for five words). stagger sets the seconds between words.
| 参数 | 类型 | 默认值 | 说明 |
|---|---|---|---|
text | string | "Every launch deserves a film." | |
accentWords | number | 1 | How many of the last words take the accent colour. |
stagger | number | 0.32 | Seconds between words. |
fontSize | number | 60 | Type size in pixels on a 540px-tall canvas. |
fontWeight | number | 600 | |
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 centered-build。CLI 会把组件源码复制到项目的 components/imgcli/ 目录并安装依赖,之后可以直接修改源码。
居中逐词成句能做什么?
一句话逐词出现并始终保持居中:新词从右侧滑入,已出现的词向左让位。
使用居中逐词成句前需要准备什么?
准备 Node.js 20.19 或更高版本,以及一个 Remotion 项目。新项目可以用 npx create-video@latest 创建。免费组件采用 MIT 许可证。