Remotion 模板 — 预构建的视频特效与动画 是做什么的?
为 Remotion 提供可复制粘贴的视频组件。开场、文字特效、转场和完整场景模板。类似于 shadcn/ui 但针对视频领域。
概述
- 仓库: github.com/reactvideoeditor/remotion-templates (77+ 星标)
- 组件库: github.com/reactvideoeditor/clippkit
- 语言: TypeScript / React
- 许可: 开源
- 安装方式: 将组件复制到你的 Remotion 项目中
使用方法
模板是你复制到项目中的 React 组件:
# 克隆模板仓库
git clone https://github.com/reactvideoeditor/remotion-templates.git
# 将所需的组件复制到你的项目中
cp remotion-templates/src/components/TextReveal.tsx my-video/src/components/
可用特效分类
文字特效
- 打字机 — 逐字显示动画
- 文字揭示 — 文字随透明度淡入向上滑入
- 动态排版 — 带弹跳动画的大标题
- 分裂文字 — 字符逐个错开动画
- 故障文字 — 数字故障效果
- 渐变文字 — 文字颜色渐变动画
转场
- 淡入淡出 — 简单的不透明度交叉溶解
- 滑动 — 方向性滑动(左、右、上、下)
- 擦除 — 方向性擦除揭示
- 缩放 — 基于缩放的转场
- 变形 — 场景间形状变形
- 故障 — 数字故障转场
开场/片尾
- 标志揭示 — 动画标志进入
- 标题卡片 — 带副标题的居中标题
- 下方三分之一 — 姓名/标题栏动画
- 结束画面 — 带社交链接的行动号召
背景
- 渐变 — 动画色彩渐变
- 粒子 — 浮动粒子系统
- 网格 — 动画网格图案
- 噪点 — 柏林噪点纹理
- 散景 — 虚化光斑
UI 模拟
- 浏览器窗口 — Chrome 风格的浏览器框架
- 手机模拟 — iPhone/Android 框架
- 代码编辑器 — VS Code 风格代码显示
- 终端 — 带打字效果的终端窗口
示例:使用文字揭示组件
import { useCurrentFrame, useVideoConfig, interpolate, spring } from "remotion";
export const TextReveal: React.FC<{ text: string; delay?: number }> = ({
text,
delay = 0,
}) => {
const frame = useCurrentFrame();
const { fps } = useVideoConfig();
const words = text.split(" ");
return (
<div style={{ display: "flex", flexWrap: "wrap", gap: 8, overflow: "hidden" }}>
{words.map((word, i) => {
const wordDelay = delay + i * 4;
const y = interpolate(frame, [wordDelay, wordDelay + 15], [40, 0], {
extrapolateLeft: "clamp",
extrapolateRight: "clamp",
});
const opacity = interpolate(frame, [wordDelay, wordDelay + 10], [0, 1], {
extrapolateLeft: "clamp",
extrapolateRight: "clamp",
});
return (
<span key={i} style={{ opacity, transform: `translateY(${y}px)`, display: "inline-block" }}>
{word}
</span>
);
})}
</div>
);
};
示例:浏览器模拟组件
export const BrowserMockup: React.FC<{
url: string;
children: React.ReactNode;
}> = ({ url, children }) => {
return (
<div style={{
borderRadius: 12,
overflow: "hidden",
boxShadow: "0 20px 60px rgba(0,0,0,0.3)",
background: "#1a1a2e",
}}>
{/* 标题栏 */}
<div style={{
display: "flex",
alignItems: "center",
padding: "12px 16px",
background: "#16213e",
gap: 8,
}}>
<div style={{ display: "flex", gap: 6 }}>
<div style={{ width: 12, height: 12, borderRadius: "50%", background: "#ff5f57" }} />
<div style={{ width: 12, height: 12, borderRadius: "50%", background: "#ffbd2e" }} />
<div style={{ width: 12, height: 12, borderRadius: "50%", background: "#28c840" }} />
</div>
<div style={{
flex: 1,
background: "#0f3460",
borderRadius: 6,
padding: "6px 12px",
fontSize: 13,
color: "#8892b0",
textAlign: "center",
}}>
{url}
</div>
</div>
{/* 内容区域 */}
<div style={{ padding: 20, minHeight: 300 }}>
{children}
</div>
</div>
);
};
最佳实践
- 复制,不要使用 npm 安装 — 模板设计为复制后自定义使用
- 根据品牌色调自定义颜色
- 调整时间 — 修改帧持续时间以匹配视频节奏
- 组合模板 — 将背景 + 文字特效 + 转场组合使用
- 保留原始文件 — 在大量修改前先复制到新文件
来源
- 模板仓库: github.com/reactvideoeditor/remotion-templates
- Clippkit 组件库: github.com/reactvideoeditor/clippkit
- 视觉浏览: reactvideoeditor.com/remotion-templates