Production-ready animations, transitions, backgrounds, and scenes for Remotion
TypeScript ai-agentsclaude-codedemo-videomcpmcp-servermodel-context-protocolmotion-designproduct-demoreactremotionshadcnvideo
feat: shared axis z
dev_wandry8b18d3877ef3
diff --git a/components/docs/examples/fade-through-example.tsx b/components/docs/examples/fade-through-example.tsxindex 6f7aa68c..2e41a829 100644--- a/components/docs/examples/fade-through-example.tsx+++ b/components/docs/examples/fade-through-example.tsx@@ -5,10 +5,10 @@ import { FadeThrough } from "@/registry/remocn/fade-through";export const FadeThroughExampleScene = () => (<>- <Sequence durationInFrames={90}>+ <Sequence durationInFrames={40}><FadeThrough fromText="Calm transitions." toText="Fade through content." /></Sequence>- <Sequence from={90} durationInFrames={90}>+ <Sequence from={40} durationInFrames={40}><FadeThroughfromText="Fade through content."toText="Focus shifts smoothly."@@ -23,10 +23,10 @@ import { FadeThrough } from "@/components/remocn/fade-through";const FadeThroughScene = () => (<>- <Sequence durationInFrames={90}>+ <Sequence durationInFrames={40}><FadeThrough fromText="Calm transitions." toText="Fade through content." /></Sequence>- <Sequence from={90} durationInFrames={90}>+ <Sequence from={40} durationInFrames={40}><FadeThrough fromText="Fade through content." toText="Focus shifts smoothly." /></Sequence></>@@ -36,7 +36,7 @@ export const RemotionRoot = () => (<Compositionid="FadeThrough"component={FadeThroughScene}- durationInFrames={180}+ durationInFrames={80}fps={30}width={1280}height={720}diff --git a/components/docs/examples/index.tsx b/components/docs/examples/index.tsxindex 55d22a0e..65f00245 100644--- a/components/docs/examples/index.tsx+++ b/components/docs/examples/index.tsx@@ -78,6 +78,10 @@ import {SharedAxisYExampleScene,sharedAxisYExampleCode,} from "./shared-axis-y-example";+import {+ SharedAxisZExampleScene,+ sharedAxisZExampleCode,+} from "./shared-axis-z-example";import {PerWordCrossfadeExampleScene,perWordCrossfadeExampleCode,@@ -370,8 +374,8 @@ export const examples: Record<string, ExampleEntry> = {"fade-through-example": {Component: FadeThroughExampleScene,code: fadeThroughExampleCode,- // Two chained A→B transitions, 90 frames each.- durationInFrames: 180,+ // Two chained A→B transitions, 40 frames each — tight delay for a dynamic feel.+ durationInFrames: 80,fps: FPS,width: W,height: H,@@ -380,8 +384,18 @@ export const examples: Record<string, ExampleEntry> = {"shared-axis-y-example": {Component: SharedAxisYExampleScene,code: sharedAxisYExampleCode,- // Two chained A→B transitions, 90 frames each.- durationInFrames: 180,+ // Two chained A→B transitions, 40 frames each — tight delay for a dynamic feel.+ durationInFrames: 80,+ fps: FPS,+ width: W,+ height: H,+ previewBackdrop: { type: "color", value: "#ffffff" },+ },+ "shared-axis-z-example": {+ Component: SharedAxisZExampleScene,+ code: sharedAxisZExampleCode,+ // Two chained A→B transitions, 40 frames each — tight delay for a dynamic feel.+ durationInFrames: 80,fps: FPS,width: W,height: H,@@ -390,8 +404,8 @@ export const examples: Record<string, ExampleEntry> = {"per-word-crossfade-example": {Component: PerWordCrossfadeExampleScene,code: perWordCrossfadeExampleCode,- // Two chained A→B transitions, 90 frames each.- durationInFrames: 180,+ // Two chained A→B transitions, 50 frames each — slower enter needs a touch more room.+ durationInFrames: 100,fps: FPS,width: W,height: H,diff --git a/components/docs/examples/per-word-crossfade-example.tsx b/components/docs/examples/per-word-crossfade-example.tsxindex 30e5b84a..9991bdb2 100644--- a/components/docs/examples/per-word-crossfade-example.tsx+++ b/components/docs/examples/per-word-crossfade-example.tsx@@ -5,13 +5,13 @@ import { PerWordCrossfade } from "@/registry/remocn/per-word-crossfade";export const PerWordCrossfadeExampleScene = () => (<>- <Sequence durationInFrames={90}>+ <Sequence durationInFrames={50}><PerWordCrossfadefromText="Beautifully simple."toText="Designed for focus."/></Sequence>- <Sequence from={90} durationInFrames={90}>+ <Sequence from={50} durationInFrames={50}><PerWordCrossfadefromText="Designed for focus."toText="Built for people."@@ -26,10 +26,10 @@ import { PerWordCrossfade } from "@/components/remocn/per-word-crossfade";const PerWordCrossfadeScene = () => (<>- <Sequence durationInFrames={90}>+ <Sequence durationInFrames={50}><PerWordCrossfade fromText="Beautifully simple." toText="Designed for focus." /></Sequence>- <Sequence from={90} durationInFrames={90}>+ <Sequence from={50} durationInFrames={50}><PerWordCrossfade fromText="Designed for focus." toText="Built for people." /></Sequence></>@@ -39,7 +39,7 @@ export const RemotionRoot = () => (<Compositionid="PerWordCrossfade"component={PerWordCrossfadeScene}- durationInFrames={180}+ durationInFrames={100}fps={30}width={1280}height={720}diff --git a/components/docs/examples/shared-axis-y-example.tsx b/components/docs/examples/shared-axis-y-example.tsxindex fd4700b8..16cbb0dd 100644--- a/components/docs/examples/shared-axis-y-example.tsx+++ b/components/docs/examples/shared-axis-y-example.tsx@@ -5,10 +5,10 @@ import { SharedAxisY } from "@/registry/remocn/shared-axis-y";export const SharedAxisYExampleScene = () => (<>- <Sequence durationInFrames={90}>+ <Sequence durationInFrames={40}><SharedAxisY fromText="Layered navigation." toText="Hierarchy made clear." /></Sequence>- <Sequence from={90} durationInFrames={90}>+ <Sequence from={40} durationInFrames={40}><SharedAxisYfromText="Hierarchy made clear."toText="Depth with restraint."@@ -23,10 +23,10 @@ import { SharedAxisY } from "@/components/remocn/shared-axis-y";const SharedAxisYScene = () => (<>- <Sequence durationInFrames={90}>+ <Sequence durationInFrames={40}><SharedAxisY fromText="Layered navigation." toText="Hierarchy made clear." /></Sequence>- <Sequence from={90} durationInFrames={90}>+ <Sequence from={40} durationInFrames={40}><SharedAxisY fromText="Hierarchy made clear." toText="Depth with restraint." /></Sequence></>@@ -36,7 +36,7 @@ export const RemotionRoot = () => (<Compositionid="SharedAxisY"component={SharedAxisYScene}- durationInFrames={180}+ durationInFrames={80}fps={30}width={1280}height={720}diff --git a/components/docs/examples/shared-axis-z-example.tsx b/components/docs/examples/shared-axis-z-example.tsxnew file mode 100644index 00000000..422c79a3--- /dev/null+++ b/components/docs/examples/shared-axis-z-example.tsx@@ -0,0 +1,41 @@+"use client";++import { Sequence } from "remotion";+import { SharedAxisZ } from "@/registry/remocn/shared-axis-z";++export const SharedAxisZExampleScene = () => (+ <>+ <Sequence durationInFrames={40}>+ <SharedAxisZ fromText="Zooming between states." toText="Elevate and settle." />+ </Sequence>+ <Sequence from={40} durationInFrames={40}>+ <SharedAxisZ fromText="Elevate and settle." toText="Scale with purpose." />+ </Sequence>+ </>+);++export const sharedAxisZExampleCode =+ (): string => `import { Composition, Sequence } from "remotion";+import { SharedAxisZ } from "@/components/remocn/shared-axis-z";++const SharedAxisZScene = () => (+ <>+ <Sequence durationInFrames={40}>+ <SharedAxisZ fromText="Zooming between states." toText="Elevate and settle." />+ </Sequence>+ <Sequence from={40} durationInFrames={40}>+ <SharedAxisZ fromText="Elevate and settle." toText="Scale with purpose." />+ </Sequence>+ </>+);++export const RemotionRoot = () => (+ <Composition+ id="SharedAxisZ"+ component={SharedAxisZScene}+ durationInFrames={80}+ fps={30}+ width={1280}+ height={720}+ />+);`;diff --git a/content/docs/components.mdx b/content/docs/components.mdxindex e8bb9009..8be4a987 100644--- a/content/docs/components.mdx+++ b/content/docs/components.mdx@@ -198,6 +198,12 @@ Text effects, reveals, and kinetic type.status: "stable",href: "/docs/typography/shared-axis-y",},+ {+ name: "SharedAxisZ",+ description: "Scale-based depth transition for focus shifts",+ status: "stable",+ href: "/docs/typography/shared-axis-z",+ },]}/>diff --git a/content/docs/typography/fade-through.mdx b/content/docs/typography/fade-through.mdxindex 347bf5ec..55efc56c 100644--- a/content/docs/typography/fade-through.mdx+++ b/content/docs/typography/fade-through.mdx@@ -18,10 +18,10 @@ import { FadeThrough } from "@/components/remocn/fade-through";const FadeThroughScene = () => (<>- <Sequence durationInFrames={90}>+ <Sequence durationInFrames={40}><FadeThrough fromText="Calm transitions." toText="Fade through content." /></Sequence>- <Sequence from={90} durationInFrames={90}>+ <Sequence from={40} durationInFrames={40}><FadeThrough fromText="Fade through content." toText="Focus shifts smoothly." /></Sequence></>@@ -31,7 +31,7 @@ export const RemotionRoot = () => (<Compositionid="FadeThrough"component={FadeThroughScene}- durationInFrames={180}+ durationInFrames={80}fps={30}width={1280}height={720}@@ -43,7 +43,7 @@ Chaining two instances in back-to-back `Sequence`s walks through a full phrase c### Chained example-This is the two-`Sequence` chain above rendered on a 180-frame timeline:+This is the two-`Sequence` chain above rendered on an 80-frame timeline:<ComponentExample name="fade-through" />diff --git a/content/docs/typography/index.mdx b/content/docs/typography/index.mdxindex 3d9de113..3e7fcb86 100644--- a/content/docs/typography/index.mdx+++ b/content/docs/typography/index.mdx@@ -196,5 +196,11 @@ Swap one phrase for another with motion.status: "stable",href: "/docs/typography/shared-axis-y",},+ {+ name: "SharedAxisZ",+ description: "Scale-based depth transition for focus shifts",+ status: "stable",+ href: "/docs/typography/shared-axis-z",+ },]}/>diff --git a/content/docs/typography/meta.json b/content/docs/typography/meta.jsonindex fab949b0..c1bbc01d 100644--- a/content/docs/typography/meta.json+++ b/content/docs/typography/meta.json@@ -16,6 +16,7 @@"per-word-crossfade","fade-through","shared-axis-y",+ "shared-axis-z","staggered-fade-up","mask-reveal-up","tracking-in",diff --git a/content/docs/typography/per-word-crossfade.mdx b/content/docs/typography/per-word-crossfade.mdxindex f76fddac..038bc58f 100644--- a/content/docs/typography/per-word-crossfade.mdx+++ b/content/docs/typography/per-word-crossfade.mdx@@ -18,10 +18,10 @@ import { PerWordCrossfade } from "@/components/remocn/per-word-crossfade";const PerWordCrossfadeScene = () => (<>- <Sequence durationInFrames={90}>+ <Sequence durationInFrames={50}><PerWordCrossfade fromText="Beautifully simple." toText="Designed for focus." /></Sequence>- <Sequence from={90} durationInFrames={90}>+ <Sequence from={50} durationInFrames={50}><PerWordCrossfade fromText="Designed for focus." toText="Built for people." /></Sequence></>@@ -31,7 +31,7 @@ export const RemotionRoot = () => (<Compositionid="PerWordCrossfade"component={PerWordCrossfadeScene}- durationInFrames={180}+ durationInFrames={100}fps={30}width={1280}height={720}@@ -43,7 +43,7 @@ Chaining two instances in back-to-back `Sequence`s walks through a full phrase c### Chained example-This is the two-`Sequence` chain above rendered on a 180-frame timeline:+This is the two-`Sequence` chain above rendered on a 100-frame timeline:<ComponentExample name="per-word-crossfade" />diff --git a/content/docs/typography/shared-axis-y.mdx b/content/docs/typography/shared-axis-y.mdxindex e6b1086f..8050dde0 100644--- a/content/docs/typography/shared-axis-y.mdx+++ b/content/docs/typography/shared-axis-y.mdx@@ -18,10 +18,10 @@ import { SharedAxisY } from "@/components/remocn/shared-axis-y";const SharedAxisYScene = () => (<>- <Sequence durationInFrames={90}>+ <Sequence durationInFrames={40}><SharedAxisY fromText="Layered navigation." toText="Hierarchy made clear." /></Sequence>- <Sequence from={90} durationInFrames={90}>+ <Sequence from={40} durationInFrames={40}><SharedAxisY fromText="Hierarchy made clear." toText="Depth with restraint." /></Sequence></>@@ -31,7 +31,7 @@ export const RemotionRoot = () => (<Compositionid="SharedAxisY"component={SharedAxisYScene}- durationInFrames={180}+ durationInFrames={80}fps={30}width={1280}height={720}@@ -43,7 +43,7 @@ Each word in the outgoing phrase snaps off in a hard cut, then the incoming phra### Chained example-This is the two-`Sequence` chain above rendered on a 180-frame timeline:+This is the two-`Sequence` chain above rendered on an 80-frame timeline:<ComponentExample name="shared-axis-y" />diff --git a/content/docs/typography/shared-axis-z.mdx b/content/docs/typography/shared-axis-z.mdxnew file mode 100644index 00000000..9ee8855e--- /dev/null+++ b/content/docs/typography/shared-axis-z.mdx@@ -0,0 +1,122 @@+---+title: Shared Axis Z+description: Scale-based shared-axis transition for focus shifts and context depth+---++<ComponentPreview name="shared-axis-z" />++## Installation++<InstallBlock name="shared-axis-z" />++## Usage++```tsx+// src/Root.tsx+import { Composition, Sequence } from "remotion";+import { SharedAxisZ } from "@/components/remocn/shared-axis-z";++const SharedAxisZScene = () => (+ <>+ <Sequence durationInFrames={40}>+ <SharedAxisZ fromText="Zooming between states." toText="Elevate and settle." />+ </Sequence>+ <Sequence from={40} durationInFrames={40}>+ <SharedAxisZ fromText="Elevate and settle." toText="Scale with purpose." />+ </Sequence>+ </>+);++export const RemotionRoot = () => (+ <Composition+ id="SharedAxisZ"+ component={SharedAxisZScene}+ durationInFrames={80}+ fps={30}+ width={1280}+ height={720}+ />+);+```++A Material shared-axis (Z) depth swap — the old phrase scales up and blurs away as it fades, while the new phrase rises from a smaller scale and sharpens into focus. Chaining two in Sequence flows A → B → C.++### Chained example++This is the two-`Sequence` chain above rendered on an 80-frame timeline:++<ComponentExample name="shared-axis-z" />++### With Backdrop++The component renders transparent — supply the background via `Backdrop`. It ships single-theme; edit the copied file to re-theme colors.++Pair with `Backdrop` to place the text inside a full-frame fill with a rounded, shadowed content frame:++```tsx+import { Composition } from "remotion";+import { SharedAxisZ } from "@/components/remocn/shared-axis-z";+import { Backdrop } from "@/components/remocn/backdrop";++const SharedAxisZScene = () => (+ <Backdrop fill={{ type: "color", value: "#ffffff" }}>+ <SharedAxisZ+ fromText="Zooming between states."+ toText="Elevate and settle."+ />+ </Backdrop>+);++export const RemotionRoot = () => (+ <Composition+ id="SharedAxisZ"+ component={SharedAxisZScene}+ durationInFrames={90}+ fps={30}+ width={1280}+ height={720}+ />+);+```++## Props++<PropsTable+ rows={[+ {+ name: "fromText",+ type: "string",+ required: true,+ description: "The outgoing phrase, scales up and fades away.",+ },+ {+ name: "toText",+ type: "string",+ required: true,+ description: "The incoming phrase, rises from a smaller scale into focus.",+ },+ {+ name: "fontSize",+ type: "number",+ default: "72",+ description: "Font size in pixels",+ },+ {+ name: "fontWeight",+ type: "number",+ default: "600",+ description: "CSS font-weight",+ },+ {+ name: "color",+ type: "string",+ default: "\"#171717\"",+ description: "Text color (any valid CSS color)",+ },+ {+ name: "className",+ type: "string",+ description: "Optional className passed to the wrapper",+ },+ ]}+/>diff --git a/registry/__index__.tsx b/registry/__index__.tsxindex 0d024d57..281a8bba 100644--- a/registry/__index__.tsx+++ b/registry/__index__.tsx@@ -33,6 +33,8 @@ import { FadeThrough } from "@/registry/remocn/fade-through";import { fadeThroughConfig } from "@/registry/remocn/fade-through/config";import { SharedAxisY } from "@/registry/remocn/shared-axis-y";import { sharedAxisYConfig } from "@/registry/remocn/shared-axis-y/config";+import { SharedAxisZ } from "@/registry/remocn/shared-axis-z";+import { sharedAxisZConfig } from "@/registry/remocn/shared-axis-z/config";import { BrowserFlow } from "@/registry/remocn/browser-flow";import { browserFlowConfig } from "@/registry/remocn/browser-flow/config";import { ChatToPreviewLayout } from "@/registry/remocn/chat-to-preview-layout";@@ -229,6 +231,7 @@ const registry: Record<string, RegistryEntry> = {"per-word-crossfade": { Component: PerWordCrossfade, config: perWordCrossfadeConfig },"fade-through": { Component: FadeThrough, config: fadeThroughConfig },"shared-axis-y": { Component: SharedAxisY, config: sharedAxisYConfig },+ "shared-axis-z": { Component: SharedAxisZ, config: sharedAxisZConfig },typewriter: { Component: Typewriter, config: typewriterConfig },"inline-highlight": {Component: InlineHighlight,diff --git a/registry/remocn/registry.json b/registry/remocn/registry.jsonindex 3a7295b5..8005ba5b 100644--- a/registry/remocn/registry.json+++ b/registry/remocn/registry.json@@ -211,6 +211,22 @@}]},+ {+ "name": "shared-axis-z",+ "type": "registry:component",+ "title": "Shared Axis Z",+ "description": "Scale-based shared-axis transition for focus shifts and context depth.",+ "dependencies": [+ "remotion"+ ],+ "files": [+ {+ "path": "shared-axis-z/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/shared-axis-z.tsx"+ }+ ]+ },{"name": "typewriter","type": "registry:component",diff --git a/registry/remocn/shared-axis-z/config.ts b/registry/remocn/shared-axis-z/config.tsnew file mode 100644index 00000000..5c966268--- /dev/null+++ b/registry/remocn/shared-axis-z/config.ts@@ -0,0 +1,36 @@+import {+ type ComponentConfig,+ FONT_WEIGHT_OPTIONS,+ FPS,+ H,+ W,+} from "@/lib/customizer-config";++export const sharedAxisZConfig: ComponentConfig = {+ componentName: "SharedAxisZ",+ importPath: "@/components/remocn/shared-axis-z",+ controls: {+ fromText: { type: "text", default: "Zooming between states.", label: "From text" },+ toText: { type: "text", default: "Elevate and settle.", label: "To text" },+ fontSize: {+ type: "number",+ default: 72,+ min: 12,+ max: 160,+ step: 1,+ label: "Font size",+ },+ color: { type: "color", default: "#171717", label: "Color" },+ fontWeight: {+ type: "select",+ default: "600",+ options: FONT_WEIGHT_OPTIONS,+ label: "Font weight",+ },+ },+ durationInFrames: 90,+ fps: FPS,+ compositionWidth: W,+ compositionHeight: H,+ previewBackdrop: { type: "color", value: "#ffffff" },+};diff --git a/registry/remocn/shared-axis-z/index.tsx b/registry/remocn/shared-axis-z/index.tsxnew file mode 100644index 00000000..a65b86c7--- /dev/null+++ b/registry/remocn/shared-axis-z/index.tsx@@ -0,0 +1,137 @@+"use client";++import { Easing, interpolate, useCurrentFrame } from "remotion";++export interface SharedAxisZProps {+ fromText: string;+ toText: string;+ fontSize?: number;+ color?: string;+ fontWeight?: number;+ speed?: number;+ className?: string;+}++export function SharedAxisZ({+ fromText,+ toText,+ fontSize = 72,+ color = "#171717",+ fontWeight = 600,+ speed = 1,+ className,+}: SharedAxisZProps) {+ const frame = useCurrentFrame() * speed;++ const enterDur = 16;+ const exitDur = 11;+ const overlapF = 3;+ const microDelayF = 1;++ const exitTotal = exitDur;+ const newStart = Math.max(0, exitTotal - overlapF + microDelayF);++ const exitEasing = Easing.bezier(0.4, 0, 1, 1);+ const enterEasing = Easing.bezier(0.2, 0, 0, 1);++ const fromOpacity = interpolate(frame, [0, exitDur], [1, 0], {+ extrapolateLeft: "clamp",+ extrapolateRight: "clamp",+ easing: exitEasing,+ });+ const fromScale = interpolate(frame, [0, exitDur], [1, 1.06], {+ extrapolateLeft: "clamp",+ extrapolateRight: "clamp",+ easing: exitEasing,+ });+ const fromBlur = interpolate(frame, [0, exitDur], [0, 1], {+ extrapolateLeft: "clamp",+ extrapolateRight: "clamp",+ easing: exitEasing,+ });++ const local = frame - newStart;+ const toOpacity = interpolate(local, [0, enterDur], [0, 1], {+ extrapolateLeft: "clamp",+ extrapolateRight: "clamp",+ easing: enterEasing,+ });+ const toScale = interpolate(local, [0, enterDur], [0.9, 1], {+ extrapolateLeft: "clamp",+ extrapolateRight: "clamp",+ easing: enterEasing,+ });+ const toBlur = interpolate(local, [0, enterDur], [2, 0], {+ extrapolateLeft: "clamp",+ extrapolateRight: "clamp",+ easing: enterEasing,+ });++ const fontStack =+ "var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif";++ return (+ <div+ className={className}+ style={{+ position: "absolute",+ inset: 0,+ background: "transparent",+ }}+ >+ <div+ style={{+ position: "absolute",+ inset: 0,+ display: "flex",+ alignItems: "center",+ justifyContent: "center",+ }}+ >+ <span+ style={{+ fontSize,+ fontWeight,+ color,+ letterSpacing: "-0.03em",+ fontFamily: fontStack,+ display: "inline-block",+ transformOrigin: "50% 50%",+ opacity: fromOpacity,+ transform: `scale(${fromScale})`,+ filter: `blur(${fromBlur}px)`,+ }}+ >+ {fromText}+ </span>+ </div>++ <div+ style={{+ position: "absolute",+ inset: 0,+ display: "flex",+ alignItems: "center",+ justifyContent: "center",+ }}+ >+ <span+ style={{+ fontSize,+ fontWeight,+ color,+ letterSpacing: "-0.03em",+ fontFamily: fontStack,+ display: "inline-block",+ transformOrigin: "50% 50%",+ opacity: toOpacity,+ transform: `scale(${toScale})`,+ filter: `blur(${toBlur}px)`,+ }}+ >+ {toText}+ </span>+ </div>+ </div>+ );+}