Production-ready animations, transitions, backgrounds, and scenes for Remotion
TypeScript ai-agentsclaude-codedemo-videomcpmcp-servermodel-context-protocolmotion-designproduct-demoreactremotionshadcnvideo
feat: kinematic slide left
dev_wandry3d83c14b5b9f
diff --git a/content/docs/components.mdx b/content/docs/components.mdxindex aa35410b..736ebfb4 100644--- a/content/docs/components.mdx+++ b/content/docs/components.mdx@@ -217,6 +217,12 @@ Text effects, reveals, and kinetic type.status: "stable",href: "/docs/typography/short-slide-right",},+ {+ name: "KineticCenterBuild",+ description: "Words enter from the right and push the line until the phrase locks centered",+ status: "stable",+ href: "/docs/typography/kinetic-center-build",+ },]}/>diff --git a/content/docs/typography/index.mdx b/content/docs/typography/index.mdxindex f165e313..d890ac48 100644--- a/content/docs/typography/index.mdx+++ b/content/docs/typography/index.mdx@@ -217,5 +217,11 @@ Word-by-word builds with motion and momentum.status: "stable",href: "/docs/typography/short-slide-right",},+ {+ name: "KineticCenterBuild",+ description: "Words enter from the right and push the line until the phrase locks centered",+ status: "stable",+ href: "/docs/typography/kinetic-center-build",+ },]}/>diff --git a/content/docs/typography/kinetic-center-build.mdx b/content/docs/typography/kinetic-center-build.mdxnew file mode 100644index 00000000..4f61da01--- /dev/null+++ b/content/docs/typography/kinetic-center-build.mdx@@ -0,0 +1,108 @@+---+title: Kinetic Center Build+description: Words enter from the right and push the line until the full phrase locks centered+---++<ComponentPreview name="kinetic-center-build" />++## Installation++<InstallBlock name="kinetic-center-build" />++## Usage++```tsx+// src/Root.tsx+import { Composition } from "remotion";+import { KineticCenterBuild } from "@/components/remocn/kinetic-center-build";++const KineticCenterBuildScene = () => (+ <KineticCenterBuild text="Words push left." entryOffset={88} />+);++export const RemotionRoot = () => (+ <Composition+ id="KineticCenterBuild"+ component={KineticCenterBuildScene}+ durationInFrames={60}+ fps={30}+ width={1280}+ height={720}+ />+);+```++Each word lands centered, then the next word slides in from the right and pushes the line left so the growing phrase stays centered at every step — reads as one kinetic line build, best for short three-word phrases.++This is a layout-aware effect — it measures word widths to keep the line centered, so it works best with short headings.++### 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 { KineticCenterBuild } from "@/components/remocn/kinetic-center-build";+import { Backdrop } from "@/components/remocn/backdrop";++const KineticCenterBuildScene = () => (+ <Backdrop fill={{ type: "color", value: "#ffffff" }}>+ <KineticCenterBuild text="Words push left." entryOffset={88} />+ </Backdrop>+);++export const RemotionRoot = () => (+ <Composition+ id="KineticCenterBuild"+ component={KineticCenterBuildScene}+ durationInFrames={60}+ fps={30}+ width={1280}+ height={720}+ />+);+```++## Props++<PropsTable+ rows={[+ {+ name: "text",+ type: "string",+ required: true,+ description: "The phrase to build, word by word. Best with short three-word phrases.",+ },+ {+ name: "entryOffset",+ type: "number",+ default: "88",+ description: "How far in pixels each incoming word starts to the right before pushing the line.",+ },+ {+ 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 phrase container",+ },+ ]}+/>diff --git a/content/docs/typography/meta.json b/content/docs/typography/meta.jsonindex ef462076..0f2b9825 100644--- a/content/docs/typography/meta.json+++ b/content/docs/typography/meta.json@@ -18,6 +18,7 @@"shared-axis-y","shared-axis-z","short-slide-right",+ "kinetic-center-build","staggered-fade-up","mask-reveal-up","tracking-in",diff --git a/registry/__index__.tsx b/registry/__index__.tsxindex ff6f19f0..6bce22c8 100644--- a/registry/__index__.tsx+++ b/registry/__index__.tsx@@ -37,6 +37,8 @@ import { SharedAxisZ } from "@/registry/remocn/shared-axis-z";import { sharedAxisZConfig } from "@/registry/remocn/shared-axis-z/config";import { ShortSlideRight } from "@/registry/remocn/short-slide-right";import { shortSlideRightConfig } from "@/registry/remocn/short-slide-right/config";+import { KineticCenterBuild } from "@/registry/remocn/kinetic-center-build";+import { kineticCenterBuildConfig } from "@/registry/remocn/kinetic-center-build/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";@@ -235,6 +237,7 @@ const registry: Record<string, RegistryEntry> = {"shared-axis-y": { Component: SharedAxisY, config: sharedAxisYConfig },"shared-axis-z": { Component: SharedAxisZ, config: sharedAxisZConfig },"short-slide-right": { Component: ShortSlideRight, config: shortSlideRightConfig },+ "kinetic-center-build": { Component: KineticCenterBuild, config: kineticCenterBuildConfig },typewriter: { Component: Typewriter, config: typewriterConfig },"inline-highlight": {Component: InlineHighlight,diff --git a/registry/remocn/kinetic-center-build/config.ts b/registry/remocn/kinetic-center-build/config.tsnew file mode 100644index 00000000..eb8ef5d3--- /dev/null+++ b/registry/remocn/kinetic-center-build/config.ts@@ -0,0 +1,43 @@+import {+ type ComponentConfig,+ FONT_WEIGHT_OPTIONS,+ FPS,+ H,+ W,+} from "@/lib/customizer-config";++export const kineticCenterBuildConfig: ComponentConfig = {+ componentName: "KineticCenterBuild",+ importPath: "@/components/remocn/kinetic-center-build",+ controls: {+ text: { type: "text", default: "Words push left.", label: "Text" },+ entryOffset: {+ type: "number",+ default: 88,+ min: 20,+ max: 160,+ step: 1,+ label: "Entry offset",+ },+ 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: 60,+ fps: FPS,+ compositionWidth: W,+ compositionHeight: H,+ previewBackdrop: { type: "color", value: "#ffffff" },+};diff --git a/registry/remocn/kinetic-center-build/index.tsx b/registry/remocn/kinetic-center-build/index.tsxnew file mode 100644index 00000000..8a3506ba--- /dev/null+++ b/registry/remocn/kinetic-center-build/index.tsx@@ -0,0 +1,182 @@+"use client";++import { useMemo } from "react";+import { Easing, interpolate, useCurrentFrame } from "remotion";++export interface KineticCenterBuildProps {+ text: string;+ entryOffset?: number;+ fontSize?: number;+ color?: string;+ fontWeight?: number;+ speed?: number;+ className?: string;+}++const FONT_FAMILY =+ "var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif";++const MEASURE_FONT =+ '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif';++function measureWidths(+ words: string[],+ fontSize: number,+ fontWeight: number,+): number[] {+ if (typeof document === "undefined") {+ return words.map((w) => w.length * fontSize * 0.55);+ }+ const ctx = document.createElement("canvas").getContext("2d");+ if (!ctx) return words.map((w) => w.length * fontSize * 0.55);+ ctx.font = `${fontWeight} ${fontSize}px ${MEASURE_FONT}`;+ return words.map((w) => ctx.measureText(w).width);+}++export function KineticCenterBuild({+ text,+ entryOffset = 88,+ fontSize = 72,+ color = "#171717",+ fontWeight = 600,+ speed = 1,+ className,+}: KineticCenterBuildProps) {+ const frame = useCurrentFrame() * speed;++ const words = useMemo(() => text.split(" "), [text]);+ const widths = useMemo(+ () => measureWidths(words, fontSize, fontWeight),+ [words, fontSize, fontWeight],+ );++ const gap = 10;+ const firstDur = 10;+ const pushDur = 13;+ const entryScale = 0.992;+ const entryBlur = 3.5;+ const reflowBlur = 0.8;+ const firstWordY = 6;+ const easing = Easing.bezier(0.2, 0.8, 0.2, 1);++ const positionsAt = useMemo(() => {+ const out: number[][] = [];+ for (let k = 1; k <= words.length; k++) {+ let total = gap * (k - 1);+ for (let j = 0; j < k; j++) total += widths[j];+ let cursor = -total / 2;+ const xs: number[] = [];+ for (let j = 0; j < k; j++) {+ xs.push(cursor + widths[j] / 2);+ cursor += widths[j] + gap;+ }+ out.push(xs);+ }+ return out;+ }, [words, widths]);++ const n = words.length;++ return (+ <div+ style={{+ position: "absolute",+ inset: 0,+ display: "flex",+ alignItems: "center",+ justifyContent: "center",+ background: "transparent",+ }}+ >+ <div+ className={className}+ style={{+ position: "relative",+ fontSize,+ fontWeight,+ color,+ letterSpacing: "-0.03em",+ fontFamily: FONT_FAMILY,+ whiteSpace: "nowrap",+ }}+ >+ {words.map((word, j) => {+ const entryStart = j === 0 ? 0 : firstDur + (j - 1) * pushDur;+ const entryEnd = entryStart + (j === 0 ? firstDur : pushDur);+ const targetX = positionsAt[j][j];+ const xFrom = j === 0 ? 0 : targetX + entryOffset;++ let x = targetX;+ let opacity = 1;+ let scale = 1;+ let blur = 0;+ let y = 0;++ if (frame < entryStart) {+ opacity = 0;+ x = xFrom;+ scale = entryScale;+ blur = entryBlur;+ y = j === 0 ? firstWordY : 0;+ } else if (frame <= entryEnd) {+ const range: [number, number] = [entryStart, entryEnd];+ const opts = {+ extrapolateLeft: "clamp" as const,+ extrapolateRight: "clamp" as const,+ easing,+ };+ x = interpolate(frame, range, [xFrom, targetX], opts);+ opacity = interpolate(frame, range, [0, 1], opts);+ scale = interpolate(frame, range, [entryScale, 1], opts);+ blur = interpolate(frame, range, [entryBlur, 0], opts);+ y = j === 0 ? interpolate(frame, range, [firstWordY, 0], opts) : 0;+ } else {+ for (let w = j + 1; w < n; w++) {+ const pushStart = firstDur + (w - 1) * pushDur;+ const pushEnd = pushStart + pushDur;+ const fromX = positionsAt[w - 1][j];+ const toX = positionsAt[w][j];+ if (frame >= pushEnd) {+ x = toX;+ } else if (frame >= pushStart) {+ x = interpolate(frame, [pushStart, pushEnd], [fromX, toX], {+ extrapolateLeft: "clamp",+ extrapolateRight: "clamp",+ easing,+ });+ blur = interpolate(+ frame,+ [pushStart, (pushStart + pushEnd) / 2, pushEnd],+ [0, reflowBlur, 0],+ { extrapolateLeft: "clamp", extrapolateRight: "clamp" },+ );+ break;+ } else {+ x = fromX;+ break;+ }+ }+ }++ return (+ <span+ key={j}+ style={{+ position: "absolute",+ left: "50%",+ top: "50%",+ whiteSpace: "nowrap",+ backfaceVisibility: "hidden",+ transform: `translate(-50%, -50%) translate3d(${x}px, ${y}px, 0) scale(${scale})`,+ filter: `blur(${blur}px)`,+ opacity,+ }}+ >+ {word}+ </span>+ );+ })}+ </div>+ </div>+ );+}diff --git a/registry/remocn/registry.json b/registry/remocn/registry.jsonindex 0edc003f..d8b9bf55 100644--- a/registry/remocn/registry.json+++ b/registry/remocn/registry.json@@ -243,6 +243,22 @@}]},+ {+ "name": "kinetic-center-build",+ "type": "registry:component",+ "title": "Kinetic Center Build",+ "description": "A word appears in the center; each new word enters from the right and pushes the line until the full phrase locks centered.",+ "dependencies": [+ "remotion"+ ],+ "files": [+ {+ "path": "kinetic-center-build/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/kinetic-center-build.tsx"+ }+ ]+ },{"name": "typewriter","type": "registry:component",