Production-ready animations, transitions, backgrounds, and scenes for Remotion
TypeScript ai-agentsclaude-codedemo-videomcpmcp-servermodel-context-protocolmotion-designproduct-demoreactremotionshadcnvideo
feat: added cc
dev_wandry9fcea7f5993b
diff --git a/content/docs/ui-blocks/claude-code.mdx b/content/docs/ui-blocks/claude-code.mdxnew file mode 100644index 00000000..6efe6a82--- /dev/null+++ b/content/docs/ui-blocks/claude-code.mdx@@ -0,0 +1,126 @@+---+title: Claude Code+description: Animated Claude Code CLI welcome screen that types a command into the terminal prompt+---++<ComponentPreview name="claude-code" />++## Installation++<InstallBlock name="claude-code" />++<Note>+ Installing `claude-code` pulls the `caret` primitive and the `remocn-ui` core lib (which provides the shared `useTypewriter` hook) via `registryDependencies`, plus the `JetBrains Mono` 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 { ClaudeCode } from "@/components/remocn/claude-code";++const ClaudeCodeScene = () => (+ <ClaudeCode+ title="Claude Code v2.0.0"+ userName="Meaghan"+ model="Sonnet 4.5 • Max 20x"+ cwd="/users/meaghan/code/apps"+ placeholder='Try "edit <filepath> to ..."'+ prompt="edit src/theme.ts to add a dark mode toggle"+ accentColor="#D97757"+ theme="dark"+ background="surface"+ speed={1}+ />+);++export const RemotionRoot = () => (+ <Composition+ id="ClaudeCode"+ component={ClaudeCodeScene}+ durationInFrames={160}+ fps={30}+ width={1280}+ height={720}+ />+);+```++Timeline: terminal window + welcome box ease in (0–20), default state with the block cursor blinking at the prompt holds (20–48), the command types into the prompt from frame 48, then holds to the end.++## Props++<PropsTable+ rows={[+ {+ name: "title",+ type: "string",+ default: "\"Claude Code v2.0.0\"",+ description: "Box title on the top border",+ },+ {+ name: "userName",+ type: "string",+ default: "\"Meaghan\"",+ description: "Name in the welcome line",+ },+ {+ name: "model",+ type: "string",+ default: "\"Sonnet 4.5 • Max 20x\"",+ description: "Model line in the left column",+ },+ {+ name: "cwd",+ type: "string",+ default: "\"/users/meaghan/code/apps\"",+ description: "Working directory line",+ },+ {+ name: "placeholder",+ type: "string",+ default: 'Try "edit <filepath> to ..."',+ description: "Muted prompt placeholder before typing",+ },+ {+ name: "prompt",+ type: "string",+ default: "\"edit src/theme.ts to add a dark mode toggle\"",+ description: "The command that types in character-by-character",+ },+ {+ name: "accentColor",+ type: "string",+ default: "\"#D97757\"",+ description: "Terracotta accent for the dashed borders and headings",+ },+ {+ name: "theme",+ type: "\"light\" | \"dark\"",+ default: "\"dark\"",+ description: "Dark or light terminal 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 command finishes typing)",+ },+ ]}+/>++## Notes++- **Sample data:** The Recent activity and What's new lists use built-in sample data.+- **Dark by default:** Defaults to the dark terminal look.+- **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 (rendered as a block cursor) shared with the other chat components.diff --git a/content/docs/ui-blocks/meta.json b/content/docs/ui-blocks/meta.jsonindex 98f9974e..b03a60ce 100644--- a/content/docs/ui-blocks/meta.json+++ b/content/docs/ui-blocks/meta.json@@ -11,6 +11,7 @@"claude-chat","chat-gpt","v0",+ "claude-code","animated-line-chart","animated-bar-chart","drag-and-drop-flow"diff --git a/registry/__index__.tsx b/registry/__index__.tsxindex 587ce593..5c297cce 100644--- a/registry/__index__.tsx+++ b/registry/__index__.tsx@@ -105,6 +105,8 @@ 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 { ClaudeCode } from "@/registry/remocn/claude-code";+import { claudeCodeConfig } from "@/registry/remocn/claude-code/config";import { ClaudeChat } from "@/registry/remocn/claude-chat";import { claudeChatConfig } from "@/registry/remocn/claude-chat/config";import { Accordion } from "@/registry/remocn-ui/accordion";@@ -338,6 +340,7 @@ const registry: Record<string, RegistryEntry> = {"claude-chat": { Component: ClaudeChat, config: claudeChatConfig },"chat-gpt": { Component: ChatGpt, config: chatGptConfig },"v0": { Component: V0, config: v0Config },+ "claude-code": { Component: ClaudeCode, config: claudeCodeConfig },"button": { Component: Button, config: buttonConfig },"accordion": { Component: Accordion, config: accordionConfig },"alert-dialog": { Component: AlertDialog, config: alertDialogConfig },@@ -499,4 +502,16 @@ if (v0) {};}+const claudeCode = registry["claude-code"];+if (claudeCode) {+ claudeCode.config.controls.speed = {+ type: "number",+ default: 1,+ min: 1,+ max: 4,+ step: 0.25,+ label: "Speed",+ };+}+export default registry;diff --git a/registry/remocn/claude-code/__tests__/claude-code.test.ts b/registry/remocn/claude-code/__tests__/claude-code.test.tsnew file mode 100644index 00000000..3c78c6a3--- /dev/null+++ b/registry/remocn/claude-code/__tests__/claude-code.test.ts@@ -0,0 +1,25 @@+import { describe, expect, it } from "vitest";+import { TYPING_CPS, TYPING_START_FRAME, WHATS_NEW } from "../index";++describe("claude-code timing constants", () => {+ it("exposes a positive typing start frame", () => {+ expect(TYPING_START_FRAME).toBeGreaterThan(0);+ });++ it("exposes a positive typing speed", () => {+ expect(TYPING_CPS).toBeGreaterThan(0);+ });+});++describe("WHATS_NEW", () => {+ it("is non-empty", () => {+ expect(WHATS_NEW.length).toBeGreaterThan(0);+ });++ it("has a non-empty string for every entry", () => {+ for (const entry of WHATS_NEW) {+ expect(typeof entry).toBe("string");+ expect(entry.length).toBeGreaterThan(0);+ }+ });+});diff --git a/registry/remocn/claude-code/config.ts b/registry/remocn/claude-code/config.tsnew file mode 100644index 00000000..bf476895--- /dev/null+++ b/registry/remocn/claude-code/config.ts@@ -0,0 +1,39 @@+import { type ComponentConfig, FPS, H, W } from "@/lib/customizer-config";++export const claudeCodeConfig: ComponentConfig = {+ componentName: "ClaudeCode",+ importPath: "@/components/remocn/claude-code",+ controls: {+ title: { type: "text", default: "Claude Code v2.0.0", label: "Title" },+ userName: { type: "text", default: "Remocn", label: "User name" },+ model: { type: "text", default: "Opus 4.8 • Max 20x", label: "Model" },+ cwd: { type: "text", default: "/users/remocn/code/apps", label: "Cwd" },+ placeholder: {+ type: "text",+ default: 'Try "edit <filepath> to ..."',+ label: "Placeholder",+ },+ prompt: {+ type: "text",+ default: "edit src/theme.ts to add a dark mode toggle",+ label: "Prompt",+ },+ accentColor: { type: "color", default: "#D97757", label: "Accent" },+ theme: {+ type: "select",+ default: "dark",+ options: ["light", "dark"],+ label: "Theme",+ },+ background: {+ type: "select",+ default: "surface",+ options: ["surface", "transparent"],+ label: "Background",+ },+ },+ durationInFrames: 160,+ fps: FPS,+ compositionWidth: W,+ compositionHeight: H,+};diff --git a/registry/remocn/claude-code/index.tsx b/registry/remocn/claude-code/index.tsxnew file mode 100644index 00000000..b363c651--- /dev/null+++ b/registry/remocn/claude-code/index.tsx@@ -0,0 +1,451 @@+"use client";++import { loadFont } from "@remotion/google-fonts/JetBrainsMono";+import {+ AbsoluteFill,+ interpolate,+ spring,+ useCurrentFrame,+ useVideoConfig,+} from "remotion";+import { Caret } from "@/components/remocn/caret";+import { useTypewriter } from "@/lib/remocn-ui";++const { fontFamily: MONO_FAMILY } = loadFont();++export interface ClaudeCodeProps {+ title?: string;+ userName?: string;+ model?: string;+ cwd?: string;+ placeholder?: string;+ prompt?: string;+ accentColor?: string;+ theme?: "light" | "dark";+ background?: "surface" | "transparent";+ speed?: number;+}++interface Theme {+ page: string;+ windowBar: string;+ windowBody: string;+ fg: string;+ fgMuted: string;+ fgDim: string;+ boxBorder: string;+}++export const THEMES: Record<"light" | "dark", Theme> = {+ light: {+ page: "#E8E5DD",+ windowBar: "#D8D3CA",+ windowBody: "#FBFAF7",+ fg: "#1F1E1D",+ fgMuted: "#73726C",+ fgDim: "#A3A097",+ boxBorder: "#D97757",+ },+ dark: {+ page: "#2B2A28",+ windowBar: "#3A3633",+ windowBody: "#1B1A18",+ fg: "#E8E5DD",+ fgMuted: "#8A857C",+ fgDim: "#6B6660",+ boxBorder: "#D97757",+ },+};++export const TYPING_START_FRAME = 48;++export const TYPING_CPS = 18;++export const WHATS_NEW: string[] = [+ "/agents to create subagents",+ "/security-review for review agent",+ "ctrl+b to background bashes",+];++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 Mascot({ accent, size = 96 }: { accent: string; size?: number }) {+ return (+ <svg+ height={size}+ viewBox="0 0 24 24"+ width={size}+ xmlns="http://www.w3.org/2000/svg"+ >+ <title>Claude Code</title>+ <path+ clipRule="evenodd"+ d="M20.998 10.949H24v3.102h-3v3.028h-1.487V20H18v-2.921h-1.487V20H15v-2.921H9V20H7.488v-2.921H6V20H4.487v-2.921H3V14.05H0V10.95h3V5h17.998v5.949zM6 10.949h1.488V8.102H6v2.847zm10.51 0H18V8.102h-1.49v2.847z"+ fill={accent}+ fillRule="evenodd"+ />+ </svg>+ );+}++export function ClaudeCode({+ title = "Claude Code v2.0.0",+ userName = "Meaghan",+ model = "Opus 4.8 • Max 20x",+ cwd = "/users/meaghan/code/apps",+ placeholder = 'Try "edit <filepath> to ..."',+ prompt = "edit src/theme.ts to add a dark mode toggle",+ accentColor = "#D97757",+ theme = "dark",+ background = "surface",+ speed = 1,+}: ClaudeCodeProps) {+ 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 showText = tw.count > 0;++ const intro = introBounceIn(frame * speed, fps);+ const leftFade = fadeUpAt(frame * speed, [6, 22]);+ const rightFade = fadeUpAt(frame * speed, [12, 30]);+ const promptFade = fadeUpAt(frame * speed, [18, 36]);++ const pageBg = background === "transparent" ? "transparent" : t.page;+ const border = accentColor;++ const winLeft = 90;+ const winTop = 40;+ const winWidth = 1100;+ const winHeight = 620;+ const barHeight = 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: winLeft,+ top: winTop,+ width: winWidth,+ height: winHeight,+ background: t.windowBody,+ borderRadius: 12,+ overflow: "hidden",+ boxShadow:+ theme === "light"+ ? "0 24px 60px -20px rgba(31,30,29,0.28)"+ : "0 24px 60px -20px rgba(0,0,0,0.6)",+ opacity: intro.scale,+ transform: `translateY(${intro.translateY}px) scale(${intro.scale})`,+ transformOrigin: "center top",+ display: "flex",+ flexDirection: "column",+ boxSizing: "border-box",+ }}+ >+ <div+ style={{+ height: barHeight,+ background: t.windowBar,+ display: "flex",+ alignItems: "center",+ gap: 8,+ paddingLeft: 16,+ flexShrink: 0,+ }}+ >+ <div+ style={{+ width: 12,+ height: 12,+ borderRadius: "50%",+ background: "#FF5F57",+ }}+ />+ <div+ style={{+ width: 12,+ height: 12,+ borderRadius: "50%",+ background: "#FEBC2E",+ }}+ />+ <div+ style={{+ width: 12,+ height: 12,+ borderRadius: "50%",+ background: "#28C840",+ }}+ />+ </div>++ <div+ style={{+ flex: 1,+ position: "relative",+ padding: 28,+ boxSizing: "border-box",+ display: "flex",+ flexDirection: "column",+ }}+ >+ <div+ style={{+ position: "relative",+ border: `1px dashed ${border}`,+ borderRadius: 6,+ padding: "28px 24px 24px",+ opacity: leftFade.opacity,+ transform: `translateY(${leftFade.translateY}px)`,+ }}+ >+ <span+ style={{+ position: "absolute",+ top: -11,+ left: 22,+ padding: "0 10px",+ background: t.windowBody,+ color: accentColor,+ fontFamily: MONO_FAMILY,+ fontSize: 16,+ fontWeight: 700,+ }}+ >+ {title}+ </span>++ <div style={{ display: "flex", flexDirection: "row" }}>+ <div+ style={{+ width: "42%",+ display: "flex",+ flexDirection: "column",+ alignItems: "flex-start",+ gap: 16,+ paddingRight: 24,+ boxSizing: "border-box",+ }}+ >+ <div+ style={{+ fontFamily: MONO_FAMILY,+ fontSize: 20,+ color: t.fg,+ }}+ >+ Welcome back {userName}!+ </div>+ <div style={{ alignSelf: "center" }}>+ <Mascot accent={accentColor} />+ </div>+ <div+ style={{+ display: "flex",+ flexDirection: "column",+ gap: 4,+ }}+ >+ <div+ style={{+ fontFamily: MONO_FAMILY,+ fontSize: 15,+ color: t.fgMuted,+ }}+ >+ {model}+ </div>+ <div+ style={{+ fontFamily: MONO_FAMILY,+ fontSize: 15,+ color: t.fgMuted,+ }}+ >+ {cwd}+ </div>+ </div>+ </div>++ <div+ style={{+ width: "58%",+ borderLeft: `1px dashed ${border}`,+ paddingLeft: 24,+ boxSizing: "border-box",+ display: "flex",+ flexDirection: "column",+ opacity: rightFade.opacity,+ transform: `translateY(${rightFade.translateY}px)`,+ }}+ >+ <div>+ <div+ style={{+ fontFamily: MONO_FAMILY,+ fontSize: 15,+ fontWeight: 700,+ color: accentColor,+ marginBottom: 10,+ }}+ >+ What's new+ </div>+ <div+ style={{+ display: "flex",+ flexDirection: "column",+ gap: 6,+ }}+ >+ {WHATS_NEW.map((line) => (+ <div+ key={line}+ style={{+ fontFamily: MONO_FAMILY,+ fontSize: 14,+ color: t.fg,+ }}+ >+ {line}+ </div>+ ))}+ <div+ style={{+ fontFamily: MONO_FAMILY,+ fontSize: 14,+ color: t.fgDim,+ }}+ >+ ... /help for more+ </div>+ </div>+ </div>+ </div>+ </div>+ </div>++ <div style={{ height: 32 }} />++ <div+ style={{+ opacity: promptFade.opacity,+ transform: `translateY(${promptFade.translateY}px)`,+ }}+ >+ <div+ style={{+ height: 1,+ background: t.fgDim,+ opacity: 0.4,+ marginBottom: 16,+ }}+ />+ <div+ style={{+ display: "flex",+ flexDirection: "row",+ alignItems: "center",+ fontFamily: MONO_FAMILY,+ fontSize: 17,+ whiteSpace: "pre",+ }}+ >+ <span style={{ color: t.fgMuted }}>{"> "}</span>+ {showText ? (+ <span+ style={{+ position: "relative",+ color: t.fg,+ display: "inline-flex",+ alignItems: "center",+ }}+ >+ {tw.text}+ <span style={{ opacity: 0.55, display: "inline-flex" }}>+ <Caret+ width={11}+ height={22}+ color={t.fg}+ blink={!tw.typing}+ speed={speed}+ marginLeft={2}+ />+ </span>+ </span>+ ) : (+ <span+ style={{+ position: "relative",+ color: t.fgMuted,+ display: "inline-flex",+ alignItems: "center",+ }}+ >+ <span style={{ opacity: 0.55, display: "inline-flex" }}>+ <Caret+ width={11}+ height={22}+ color={t.fg}+ blink={!tw.typing}+ speed={speed}+ />+ </span>+ <span style={{ marginLeft: 6 }}>{placeholder}</span>+ </span>+ )}+ </div>+ </div>+ </div>+ </div>+ </div>+ </AbsoluteFill>+ );+}diff --git a/registry/remocn/registry.json b/registry/remocn/registry.jsonindex 7c25fb73..a0a19a82 100644--- a/registry/remocn/registry.json+++ b/registry/remocn/registry.json@@ -751,6 +751,21 @@}]},+ {+ "name": "claude-code",+ "type": "registry:component",+ "title": "Claude Code",+ "description": "Animated Claude Code CLI welcome screen — terminal window with a dashed welcome box, recent activity and what's new panels, and a prompt line that types a command with a block cursor. Dark/light themes.",+ "dependencies": ["remotion", "@remotion/google-fonts"],+ "registryDependencies": ["@remocn/caret", "@remocn/remocn-ui"],+ "files": [+ {+ "path": "claude-code/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/claude-code.tsx"+ }+ ]+ },{"name": "confetti","type": "registry:component",