Skip to content

Production-ready animations, transitions, backgrounds, and scenes for Remotion

feat: create v0 component

dev_wandrybbdf97b28fdc
diff --git a/content/docs/ui-blocks/meta.json b/content/docs/ui-blocks/meta.json
index adc0722c..98f9974e 100644
--- a/content/docs/ui-blocks/meta.json
+++ b/content/docs/ui-blocks/meta.json
@@ -10,6 +10,7 @@
"tool-menu-slide-in",
"claude-chat",
"chat-gpt",
+ "v0",
"animated-line-chart",
"animated-bar-chart",
"drag-and-drop-flow"
diff --git a/content/docs/ui-blocks/v0.mdx b/content/docs/ui-blocks/v0.mdx
new file mode 100644
index 00000000..9001473e
--- /dev/null
+++ b/content/docs/ui-blocks/v0.mdx
@@ -0,0 +1,112 @@
+---
+title: v0
+description: Animated Vercel v0 composer that types a prompt and morphs the mic button into a send button
+---
+
+<ComponentPreview name="v0" />
+
+## Installation
+
+<InstallBlock name="v0" />
+
+<Note>
+ Installing `v0` pulls the `caret` primitive and the `remocn-ui` core lib (which provides the shared `useTypewriter` hook) via `registryDependencies`, plus the `Inter` font via `@remotion/google-fonts` automatically. No additional install needed.
+</Note>
+
+## Usage
+
+Standalone in a Remotion `<Composition>` — renders immediately after install:
+
+```tsx
+// src/Root.tsx
+import { Composition } from "remotion";
+import { V0 } from "@/components/remocn/v0";
+
+const V0Scene = () => (
+ <V0
+ greeting="What do you want to create?"
+ placeholder="Ask v0 to build…"
+ prompt="a landing page for my SaaS with pricing and testimonials"
+ modelName="v0 Max"
+ projectName="Project"
+ theme="dark"
+ background="surface"
+ speed={1}
+ />
+);
+
+export const RemotionRoot = () => (
+ <Composition
+ id="V0"
+ component={V0Scene}
+ durationInFrames={150}
+ fps={30}
+ width={1280}
+ height={720}
+ />
+);
+```
+
+Timeline: heading + box ease in (0–16), default state with blinking caret holds (16–42), the prompt types in from frame 42, the white mic button morphs into a send button the instant text appears, then holds to the end.
+
+## Props
+
+<PropsTable
+ rows={[
+ {
+ name: "greeting",
+ type: "string",
+ default: "\"What do you want to create?\"",
+ description: "Bold heading above the box",
+ },
+ {
+ name: "placeholder",
+ type: "string",
+ default: "\"Ask v0 to build…\"",
+ description: "Muted placeholder before typing",
+ },
+ {
+ name: "prompt",
+ type: "string",
+ default: "\"a landing page for my SaaS with pricing and testimonials\"",
+ description: "The text that types in character-by-character",
+ },
+ {
+ name: "modelName",
+ type: "string",
+ default: "\"v0 Max\"",
+ description: "Model chip label in the toolbar",
+ },
+ {
+ name: "projectName",
+ type: "string",
+ default: "\"Project\"",
+ description: "Project selector label",
+ },
+ {
+ name: "theme",
+ type: "\"light\" | \"dark\"",
+ default: "\"dark\"",
+ description: "Dark or light color theme",
+ },
+ {
+ name: "background",
+ type: "\"surface\" | \"transparent\"",
+ default: "\"surface\"",
+ description: "Page background fill or transparent",
+ },
+ {
+ name: "speed",
+ type: "number",
+ default: "1",
+ description: "Animation speed multiplier (minimum 1 so the prompt finishes typing)",
+ },
+ ]}
+/>
+
+## Notes
+
+- **Dark by default:** Defaults to the dark v0 look.
+- **Button morph:** The mic-to-send morph is gated purely on text presence — the moment the prompt has any characters, the send button appears.
+- **Offline-friendly:** No network requests or images are used, so the preview works offline and MP4 export requires no CORS setup.
+- **Shared hook:** Reuses the `useTypewriter` hook and the `caret` primitive shared with the other chat components.
diff --git a/registry/__index__.tsx b/registry/__index__.tsx
index 4c0d700d..587ce593 100644
--- a/registry/__index__.tsx
+++ b/registry/__index__.tsx
@@ -103,6 +103,8 @@ import { Confetti } from "@/registry/remocn/confetti";
import { confettiConfig } from "@/registry/remocn/confetti/config";
import { ChatGpt } from "@/registry/remocn/chat-gpt";
import { chatGptConfig } from "@/registry/remocn/chat-gpt/config";
+import { V0 } from "@/registry/remocn/v0";
+import { v0Config } from "@/registry/remocn/v0/config";
import { ClaudeChat } from "@/registry/remocn/claude-chat";
import { claudeChatConfig } from "@/registry/remocn/claude-chat/config";
import { Accordion } from "@/registry/remocn-ui/accordion";
@@ -335,6 +337,7 @@ const registry: Record<string, RegistryEntry> = {
"confetti": { Component: Confetti, config: confettiConfig },
"claude-chat": { Component: ClaudeChat, config: claudeChatConfig },
"chat-gpt": { Component: ChatGpt, config: chatGptConfig },
+ "v0": { Component: V0, config: v0Config },
"button": { Component: Button, config: buttonConfig },
"accordion": { Component: Accordion, config: accordionConfig },
"alert-dialog": { Component: AlertDialog, config: alertDialogConfig },
@@ -484,4 +487,16 @@ if (chatGpt) {
};
}
+const v0 = registry["v0"];
+if (v0) {
+ v0.config.controls.speed = {
+ type: "number",
+ default: 1,
+ min: 1,
+ max: 4,
+ step: 0.25,
+ label: "Speed",
+ };
+}
+
export default registry;
diff --git a/registry/remocn/registry.json b/registry/remocn/registry.json
index aa5e3cbb..7c25fb73 100644
--- a/registry/remocn/registry.json
+++ b/registry/remocn/registry.json
@@ -736,6 +736,21 @@
}
]
},
+ {
+ "name": "v0",
+ "type": "registry:component",
+ "title": "v0",
+ "description": "Animated Vercel v0 composer — types a prompt into the dark textarea and the mic button morphs into a send button. Dark/light themes.",
+ "dependencies": ["remotion", "@remotion/google-fonts"],
+ "registryDependencies": ["@remocn/caret", "@remocn/remocn-ui"],
+ "files": [
+ {
+ "path": "v0/index.tsx",
+ "type": "registry:component",
+ "target": "components/remocn/v0.tsx"
+ }
+ ]
+ },
{
"name": "confetti",
"type": "registry:component",
diff --git a/registry/remocn/v0/__tests__/v0.test.ts b/registry/remocn/v0/__tests__/v0.test.ts
new file mode 100644
index 00000000..bfec4c43
--- /dev/null
+++ b/registry/remocn/v0/__tests__/v0.test.ts
@@ -0,0 +1,48 @@
+import { describe, expect, it } from "vitest";
+
+import { TYPING_CPS, TYPING_START_FRAME, morphProgressAt } from "../index";
+
+const FPS = 30;
+
+describe("typing constants", () => {
+ it("starts typing on a positive frame offset", () => {
+ expect(TYPING_START_FRAME).toBeGreaterThan(0);
+ });
+
+ it("types at a positive characters-per-second rate", () => {
+ expect(TYPING_CPS).toBeGreaterThan(0);
+ });
+});
+
+describe("morphProgressAt", () => {
+ it("is at or near 0 before the start frame", () => {
+ for (let f = 0; f < TYPING_START_FRAME; f++) {
+ const val = morphProgressAt(f, { fps: FPS, speed: 1 });
+ expect(val).toBeLessThanOrEqual(0.001);
+ }
+ });
+
+ it("increases after the start frame", () => {
+ const early = morphProgressAt(TYPING_START_FRAME + 3, {
+ fps: FPS,
+ speed: 1,
+ });
+ const later = morphProgressAt(TYPING_START_FRAME + 12, {
+ fps: FPS,
+ speed: 1,
+ });
+ expect(later).toBeGreaterThan(early);
+ });
+
+ it("stays within [0, 1] for every frame", () => {
+ for (let f = 0; f <= 300; f++) {
+ const val = morphProgressAt(f, { fps: FPS, speed: 1 });
+ expect(val).toBeGreaterThanOrEqual(0);
+ expect(val).toBeLessThanOrEqual(1);
+ }
+ });
+
+ it("approaches 1 for large frames", () => {
+ expect(morphProgressAt(300, { fps: FPS, speed: 1 })).toBeCloseTo(1, 2);
+ });
+});
diff --git a/registry/remocn/v0/config.ts b/registry/remocn/v0/config.ts
new file mode 100644
index 00000000..ee176012
--- /dev/null
+++ b/registry/remocn/v0/config.ts
@@ -0,0 +1,41 @@
+import { type ComponentConfig, FPS, H, W } from "@/lib/customizer-config";
+
+export const v0Config: ComponentConfig = {
+ componentName: "V0",
+ importPath: "@/components/remocn/v0",
+ controls: {
+ greeting: {
+ type: "text",
+ default: "What do you want to create?",
+ label: "Greeting",
+ },
+ placeholder: {
+ type: "text",
+ default: "Ask v0 to build…",
+ label: "Placeholder",
+ },
+ prompt: {
+ type: "text",
+ default: "a landing page for my SaaS with pricing and testimonials",
+ label: "Prompt",
+ },
+ modelName: { type: "text", default: "v0 Max", label: "Model" },
+ projectName: { type: "text", default: "Project", label: "Project" },
+ theme: {
+ type: "select",
+ default: "dark",
+ options: ["light", "dark"],
+ label: "Theme",
+ },
+ background: {
+ type: "select",
+ default: "surface",
+ options: ["surface", "transparent"],
+ label: "Background",
+ },
+ },
+ durationInFrames: 150,
+ fps: FPS,
+ compositionWidth: W,
+ compositionHeight: H,
+};
diff --git a/registry/remocn/v0/index.tsx b/registry/remocn/v0/index.tsx
new file mode 100644
index 00000000..1f08d366
--- /dev/null
+++ b/registry/remocn/v0/index.tsx
@@ -0,0 +1,428 @@
+"use client";
+
+import { loadFont } from "@remotion/google-fonts/Inter";
+import {
+ AbsoluteFill,
+ interpolate,
+ spring,
+ useCurrentFrame,
+ useVideoConfig,
+} from "remotion";
+import { Caret } from "@/components/remocn/caret";
+import { useTypewriter } from "@/lib/remocn-ui";
+
+const { fontFamily: SANS_FAMILY } = loadFont();
+
+export interface V0Props {
+ greeting?: string;
+ placeholder?: string;
+ prompt?: string;
+ modelName?: string;
+ projectName?: string;
+ theme?: "light" | "dark";
+ background?: "surface" | "transparent";
+ speed?: number;
+}
+
+interface Theme {
+ page: string;
+ boxBg: string;
+ boxBorder: string;
+ fg: string;
+ fgMuted: string;
+ iconColor: string;
+ btnBg: string;
+ btnFg: string;
+}
+
+export const THEMES: Record<"light" | "dark", Theme> = {
+ light: {
+ page: "#FFFFFF",
+ boxBg: "#FFFFFF",
+ boxBorder: "#E3E3E3",
+ fg: "#0D0D0D",
+ fgMuted: "#8A8A8A",
+ iconColor: "#5D5D5D",
+ btnBg: "#0D0D0D",
+ btnFg: "#FFFFFF",
+ },
+ dark: {
+ page: "#000000",
+ boxBg: "#0A0A0A",
+ boxBorder: "#2A2A2A",
+ fg: "#EDEDED",
+ fgMuted: "#8A8A8A",
+ iconColor: "#A0A0A0",
+ btnBg: "#FFFFFF",
+ btnFg: "#0A0A0A",
+ },
+};
+
+export const TYPING_START_FRAME = 42;
+
+export const TYPING_CPS = 22;
+
+export function morphProgressAt(
+ frame: number,
+ opts: { startFrame?: number; fps: number; speed: number },
+): number {
+ const startFrame = opts.startFrame ?? TYPING_START_FRAME;
+ const value = spring({
+ fps: opts.fps,
+ frame: frame * opts.speed - startFrame,
+ config: { damping: 14, stiffness: 200, mass: 0.6 },
+ });
+ return Math.max(0, Math.min(value, 1));
+}
+
+function introBounceIn(
+ frame: number,
+ fps: number,
+): { translateY: number; scale: number } {
+ const s = spring({
+ fps,
+ frame,
+ config: { damping: 14, stiffness: 110, mass: 0.7 },
+ });
+ const translateY = interpolate(s, [0, 1], [28, 0]);
+ const scale = interpolate(s, [0, 1], [0.97, 1]);
+ return { translateY, scale };
+}
+
+function fadeUpAt(
+ frame: number,
+ range: [number, number],
+): { opacity: number; translateY: number } {
+ const opts = {
+ extrapolateLeft: "clamp" as const,
+ extrapolateRight: "clamp" as const,
+ };
+ return {
+ opacity: interpolate(frame, range, [0, 1], opts),
+ translateY: interpolate(frame, range, [12, 0], opts),
+ };
+}
+
+function PlusIcon({ size, color }: { size: number; color: string }) {
+ return (
+ <svg width={size} height={size} viewBox="0 0 24 24" fill="none">
+ <title>Add</title>
+ <path
+ d="M12 5v14M5 12h14"
+ stroke={color}
+ strokeWidth={2}
+ strokeLinecap="round"
+ />
+ </svg>
+ );
+}
+
+function V0LogoIcon({ size, color }: { size: number; color: string }) {
+ return (
+ <svg width={size} height={size} viewBox="0 0 24 24" fill="none">
+ <title>v0</title>
+ <rect
+ x={2.5}
+ y={2.5}
+ width={19}
+ height={19}
+ rx={5}
+ stroke={color}
+ strokeWidth={1.8}
+ />
+ <rect
+ x={7.5}
+ y={7.5}
+ width={9}
+ height={9}
+ rx={2.5}
+ stroke={color}
+ strokeWidth={1.8}
+ />
+ </svg>
+ );
+}
+
+function ChevronDownIcon({ size, color }: { size: number; color: string }) {
+ return (
+ <svg width={size} height={size} viewBox="0 0 24 24" fill="none">
+ <title>Expand</title>
+ <path
+ d="M6 9l6 6 6-6"
+ stroke={color}
+ strokeWidth={2}
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ />
+ </svg>
+ );
+}
+
+function MicIcon({ size, color }: { size: number; color: string }) {
+ return (
+ <svg width={size} height={size} viewBox="0 0 24 24" fill="none">
+ <title>Voice input</title>
+ <rect
+ x={9}
+ y={3}
+ width={6}
+ height={11}
+ rx={3}
+ stroke={color}
+ strokeWidth={1.8}
+ />
+ <path
+ d="M5.5 11a6.5 6.5 0 0013 0M12 17.5V21M9 21h6"
+ stroke={color}
+ strokeWidth={1.8}
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ />
+ </svg>
+ );
+}
+
+function ArrowUpIcon({ size, color }: { size: number; color: string }) {
+ return (
+ <svg width={size} height={size} viewBox="0 0 24 24" fill="none">
+ <title>Send</title>
+ <path
+ d="M12 19V6M12 6l-6 6M12 6l6 6"
+ stroke={color}
+ strokeWidth={2.2}
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ />
+ </svg>
+ );
+}
+
+export function V0({
+ greeting = "What do you want to create?",
+ placeholder = "Ask v0 to build…",
+ prompt = "a landing page for my SaaS with pricing and testimonials",
+ modelName = "v0 Max",
+ projectName = "Project",
+ theme = "dark",
+ background = "surface",
+ speed = 1,
+}: V0Props) {
+ const frame = useCurrentFrame();
+ const { width, height, fps } = useVideoConfig();
+ const t = THEMES[theme] ?? THEMES.dark;
+
+ const refW = 1280;
+ const refH = 720;
+ const stageScale = Math.min(width / refW, height / refH);
+
+ const tw = useTypewriter(prompt, {
+ cps: TYPING_CPS,
+ speed,
+ startFrame: TYPING_START_FRAME,
+ });
+ const visibleText = tw.text;
+ const showText = tw.count > 0;
+ const morph = morphProgressAt(frame, { fps, speed });
+
+ const intro = introBounceIn(frame * speed, fps);
+ const headingFade = fadeUpAt(frame * speed, [4, 20]);
+ const boxFade = fadeUpAt(frame * speed, [10, 26]);
+
+ const pageBg = background === "transparent" ? "transparent" : t.page;
+
+ const boxWidth = 880;
+ const boxLeft = (refW - boxWidth) / 2;
+ const boxTop = 270;
+ const boxHeight = 150;
+ const btnSize = 40;
+
+ return (
+ <AbsoluteFill style={{ background: pageBg }}>
+ <div
+ style={{
+ position: "absolute",
+ left: "50%",
+ top: "50%",
+ width: refW,
+ height: refH,
+ transform: `translate(-50%, -50%) scale(${stageScale})`,
+ }}
+ >
+ <div
+ style={{
+ position: "absolute",
+ left: 0,
+ top: 150,
+ width: refW,
+ textAlign: "center",
+ fontFamily: SANS_FAMILY,
+ fontSize: 44,
+ fontWeight: 700,
+ color: t.fg,
+ opacity: headingFade.opacity,
+ transform: `translateY(${headingFade.translateY + intro.translateY * 0.4}px)`,
+ }}
+ >
+ {greeting}
+ </div>
+
+ <div
+ style={{
+ position: "absolute",
+ left: boxLeft,
+ top: boxTop,
+ width: boxWidth,
+ height: boxHeight,
+ background: t.boxBg,
+ border: `1px solid ${t.boxBorder}`,
+ borderRadius: 16,
+ boxShadow:
+ theme === "light"
+ ? "0 8px 30px -14px rgba(13,13,13,0.12)"
+ : "0 8px 40px -16px rgba(0,0,0,0.8)",
+ opacity: boxFade.opacity,
+ transform: `translateY(${boxFade.translateY + intro.translateY * 0.6}px) scale(${intro.scale})`,
+ transformOrigin: "center top",
+ display: "flex",
+ flexDirection: "column",
+ boxSizing: "border-box",
+ }}
+ >
+ <div
+ style={{
+ flex: 1,
+ padding: "18px 20px",
+ fontFamily: SANS_FAMILY,
+ fontSize: 18,
+ color: t.fg,
+ display: "flex",
+ alignItems: "flex-start",
+ overflow: "hidden",
+ }}
+ >
+ {showText ? (
+ <span
+ style={{
+ color: t.fg,
+ whiteSpace: "pre-wrap",
+ }}
+ >
+ {visibleText}
+ <Caret
+ color={t.fg}
+ blink={!tw.typing}
+ speed={speed}
+ height={20}
+ marginLeft={2}
+ />
+ </span>
+ ) : (
+ <span
+ style={{
+ color: t.fgMuted,
+ display: "inline-flex",
+ alignItems: "center",
+ }}
+ >
+ <Caret color={t.fg} blink={!tw.typing} speed={speed} height={20} />
+ <span style={{ marginLeft: 6 }}>{placeholder}</span>
+ </span>
+ )}
+ </div>
+
+ <div
+ style={{
+ padding: "12px 16px",
+ display: "flex",
+ justifyContent: "space-between",
+ alignItems: "center",
+ }}
+ >
+ <div style={{ display: "flex", alignItems: "center", gap: 10 }}>
+ <PlusIcon size={20} color={t.iconColor} />
+ <div
+ style={{
+ display: "inline-flex",
+ alignItems: "center",
+ gap: 7,
+ }}
+ >
+ <V0LogoIcon size={18} color={t.fg} />
+ <span
+ style={{
+ fontFamily: SANS_FAMILY,
+ fontSize: 15,
+ fontWeight: 500,
+ color: t.fg,
+ }}
+ >
+ {modelName}
+ </span>
+ <ChevronDownIcon size={14} color={t.fgMuted} />
+ </div>
+ </div>
+
+ <div style={{ display: "flex", alignItems: "center", gap: 12 }}>
+ <div
+ style={{
+ display: "inline-flex",
+ alignItems: "center",
+ gap: 4,
+ }}
+ >
+ <span
+ style={{
+ fontFamily: SANS_FAMILY,
+ fontSize: 15,
+ color: t.fgMuted,
+ }}
+ >
+ {projectName}
+ </span>
+ <ChevronDownIcon size={14} color={t.fgMuted} />
+ </div>
+
+ <div
+ style={{
+ position: "relative",
+ width: btnSize,
+ height: btnSize,
+ borderRadius: 10,
+ background: t.btnBg,
+ flexShrink: 0,
+ }}
+ >
+ <div
+ style={{
+ position: "absolute",
+ inset: 0,
+ display: "flex",
+ alignItems: "center",
+ justifyContent: "center",
+ opacity: 1 - morph,
+ transform: `scale(${1 - 0.08 * morph})`,
+ }}
+ >
+ <MicIcon size={20} color={t.btnFg} />
+ </div>
+ <div
+ style={{
+ position: "absolute",
+ inset: 0,
+ display: "flex",
+ alignItems: "center",
+ justifyContent: "center",
+ opacity: morph,
+ transform: `scale(${0.85 + 0.15 * morph})`,
+ }}
+ >
+ <ArrowUpIcon size={20} color={t.btnFg} />
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </AbsoluteFill>
+ );
+}