Skip to content

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

feat: paper wobble

kapishdima2abe8639c6a3
diff --git a/components/docs/examples/paper-wobble-example.tsx b/components/docs/examples/paper-wobble-example.tsx
new file mode 100644
index 00000000..c1896f49
--- /dev/null
+++ b/components/docs/examples/paper-wobble-example.tsx
@@ -0,0 +1,92 @@
+"use client";
+
+import { AbsoluteFill } from "remotion";
+import { PaperWobble } from "@/registry/remocn/paper-wobble";
+
+const INK = "#26242c";
+const PENCIL = "rgba(38,36,44,0.55)";
+
+const FONT_FAMILY =
+ "var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif";
+
+function Card() {
+ return (
+ <div
+ style={{
+ background: "#fdfcf8",
+ border: "1px solid rgba(38,36,44,0.12)",
+ borderRadius: 4,
+ padding: "24px 32px",
+ boxShadow: "0 8px 20px rgba(38,36,44,0.12)",
+ fontFamily: FONT_FAMILY,
+ }}
+ >
+ <div style={{ fontSize: 28, fontWeight: 600, color: INK }}>
+ Shot on a desk
+ </div>
+ <div style={{ fontSize: 18, color: PENCIL, marginTop: 6 }}>
+ Every pose is placed by hand
+ </div>
+ </div>
+ );
+}
+
+export function PaperWobbleExampleScene({
+ amp,
+ rotAmp,
+ seed = "wobble",
+ step,
+}: {
+ amp?: number;
+ rotAmp?: number;
+ seed?: string;
+ step?: number;
+}) {
+ return (
+ <AbsoluteFill
+ style={{
+ alignItems: "center",
+ justifyContent: "center",
+ flexDirection: "column",
+ gap: 40,
+ }}
+ >
+ <PaperWobble seed={`${seed}:title`} amp={amp} rotAmp={rotAmp} step={step}>
+ <div
+ style={{
+ fontFamily: FONT_FAMILY,
+ fontSize: 64,
+ fontWeight: 600,
+ color: INK,
+ }}
+ >
+ Paper Wobble
+ </div>
+ </PaperWobble>
+ <PaperWobble seed={`${seed}:card`} amp={amp} rotAmp={rotAmp} step={step}>
+ <Card />
+ </PaperWobble>
+ </AbsoluteFill>
+ );
+}
+
+export const paperWobbleExampleCode = (
+ values: Record<string, unknown>,
+): string => {
+ const amp = (values.amp as number) ?? 1.4;
+ const rotAmp = (values.rotAmp as number) ?? 0.35;
+ const seed = (values.seed as string) ?? "wobble";
+ const step = (values.step as number) ?? 3;
+ return `import { PaperWobble } from "@/components/remocn/paper-wobble";
+
+export const MyScene = () => (
+ <>
+ <PaperWobble seed="${seed}:title" amp={${amp}} rotAmp={${rotAmp}} step={${step}}>
+ <h1>Paper Wobble</h1>
+ </PaperWobble>
+ <PaperWobble seed="${seed}:card" amp={${amp}} rotAmp={${rotAmp}} step={${step}}>
+ <YourCard />
+ </PaperWobble>
+ </>
+);`;
+};
diff --git a/content/docs/components.mdx b/content/docs/components.mdx
index cf440686..2e4e5066 100644
--- a/content/docs/components.mdx
+++ b/content/docs/components.mdx
@@ -434,6 +434,21 @@ Scene transitions, camera moves, and stylized wipes.
]}
/>
+## Effects
+
+Physical overlays and hand-made motion.
+
+<ComponentCardGrid
+ items={[
+ {
+ name: "PaperWobble",
+ description: "Per-pose reshoot jitter that makes any content feel hand-placed on a desk",
+ status: "stable",
+ href: "/docs/effects/paper-wobble",
+ },
+ ]}
+/>
+
## Compositions
Full scenes built by composing primitives and UI blocks.
diff --git a/content/docs/effects/meta.json b/content/docs/effects/meta.json
index 3db0aeb8..e72e2dad 100644
--- a/content/docs/effects/meta.json
+++ b/content/docs/effects/meta.json
@@ -1,5 +1,5 @@
{
"title": "Effects",
"collapsible": false,
- "pages": ["index", "confetti"]
+ "pages": ["index", "confetti", "paper-wobble"]
}
diff --git a/content/docs/effects/paper-wobble.mdx b/content/docs/effects/paper-wobble.mdx
new file mode 100644
index 00000000..45d57ba4
--- /dev/null
+++ b/content/docs/effects/paper-wobble.mdx
@@ -0,0 +1,108 @@
+---
+title: Paper Wobble
+description: Per-pose reshoot jitter that makes any content feel hand-placed on a desk
+---
+
+<ComponentPreview name="paper-wobble" />
+
+## Installation
+
+<InstallBlock name="paper-wobble" />
+
+## Usage
+
+Wrap anything. The wrapper holds one offset for a whole stop-motion pose, then
+snaps to the next — the wobble of a photo that was picked up and put back down.
+
+```tsx
+// src/Root.tsx
+import { AbsoluteFill, Composition } from "remotion";
+import { PaperWobble } from "@/components/remocn/paper-wobble";
+
+const PaperWobbleScene = () => (
+ <AbsoluteFill
+ style={{
+ background: "#f1eee7",
+ alignItems: "center",
+ justifyContent: "center",
+ flexDirection: "column",
+ gap: 40,
+ }}
+ >
+ <PaperWobble seed="title">
+ <h1 style={{ fontSize: 64, color: "#26242c" }}>Shot on a desk</h1>
+ </PaperWobble>
+ <PaperWobble seed="card">
+ <YourCard />
+ </PaperWobble>
+ </AbsoluteFill>
+);
+
+export const RemotionRoot = () => (
+ <Composition
+ id="PaperWobble"
+ component={PaperWobbleScene}
+ durationInFrames={90}
+ fps={30}
+ width={1280}
+ height={720}
+ />
+);
+```
+
+Give each wrapped block its own `seed` — two instances sharing a seed move in
+lockstep, which reads as one rigid sheet rather than two objects on a desk.
+
+Components that already carry their own jitter, like `paper-sticker`, do not
+need this wrapper — doubling it up just doubles the shake.
+
+The wrapper is `display: inline-block` and nothing else: no size, no
+background, no positioning. If you pass a `transform` through `style`, it is
+applied first and the jitter is appended, so your own positioning survives.
+
+## Props
+
+<PropsTable
+ rows={[
+ {
+ name: "children",
+ type: "React.ReactNode",
+ required: true,
+ description: "The content to wobble",
+ },
+ {
+ name: "seed",
+ type: "string",
+ default: "\"wobble\"",
+ description: "Seed for the jitter — same seed, same motion",
+ },
+ {
+ name: "amp",
+ type: "number",
+ default: "1.4",
+ description: "Maximum offset in pixels on each axis",
+ },
+ {
+ name: "rotAmp",
+ type: "number",
+ default: "0.35",
+ description: "Maximum rotation in degrees",
+ },
+ {
+ name: "step",
+ type: "number",
+ default: "3",
+ description: "Frames per stop-motion pose — the tempo control",
+ },
+ {
+ name: "className",
+ type: "string",
+ description: "Passed through to the wrapper div",
+ },
+ {
+ name: "style",
+ type: "React.CSSProperties",
+ description: "Merged over the defaults; a transform here is composed before the jitter",
+ },
+ ]}
+/>
diff --git a/registry-artifacts/paper-wobble.json b/registry-artifacts/paper-wobble.json
new file mode 100644
index 00000000..8e2e5374
--- /dev/null
+++ b/registry-artifacts/paper-wobble.json
@@ -0,0 +1,17 @@
+{
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
+ "name": "paper-wobble",
+ "title": "Paper Wobble",
+ "description": "Per-pose reshoot jitter that makes any content feel hand-placed on a desk.",
+ "dependencies": ["remotion"],
+ "registryDependencies": ["@remocn/stop-motion"],
+ "files": [
+ {
+ "path": "registry/remocn/paper-wobble/index.tsx",
+ "content": "\"use client\";\n\nimport type React from \"react\";\nimport { useCurrentFrame } from \"remotion\";\nimport { DEFAULT_STEP, paperJitter } from \"@/lib/remocn/stop-motion\";\n\nexport interface PaperWobbleProps {\n children: React.ReactNode;\n seed?: string;\n amp?: number;\n rotAmp?: number;\n step?: number;\n className?: string;\n style?: React.CSSProperties;\n}\n\nexport function PaperWobble({\n children,\n seed = \"wobble\",\n amp = 1.4,\n rotAmp = 0.35,\n step = DEFAULT_STEP,\n className,\n style,\n}: PaperWobbleProps) {\n const frame = useCurrentFrame();\n const jitter = paperJitter(frame, seed, { amp, rotAmp, step });\n const wobble = `translate(${jitter.x}px, ${jitter.y}px) rotate(${jitter.rot}deg)`;\n\n return (\n <div\n className={className}\n style={{\n display: \"inline-block\",\n ...style,\n transform: style?.transform ? `${style.transform} ${wobble}` : wobble,\n }}\n >\n {children}\n </div>\n );\n}\n",
+ "type": "registry:component",
+ "target": "components/remocn/paper-wobble.tsx"
+ }
+ ],
+ "type": "registry:component"
+}
diff --git a/registry-artifacts/registry.json b/registry-artifacts/registry.json
index 80316937..421e4bd4 100644
--- a/registry-artifacts/registry.json
+++ b/registry-artifacts/registry.json
@@ -1313,6 +1313,21 @@
],
"type": "registry:component"
},
+ {
+ "name": "paper-wobble",
+ "title": "Paper Wobble",
+ "description": "Per-pose reshoot jitter that makes any content feel hand-placed on a desk.",
+ "dependencies": ["remotion"],
+ "registryDependencies": ["@remocn/stop-motion"],
+ "files": [
+ {
+ "path": "registry/remocn/paper-wobble/index.tsx",
+ "type": "registry:component",
+ "target": "components/remocn/paper-wobble.tsx"
+ }
+ ],
+ "type": "registry:component"
+ },
{
"name": "stop-motion",
"title": "Stop Motion Clock",
diff --git a/registry/__index__.tsx b/registry/__index__.tsx
index 164c3cd9..6f5c28d7 100644
--- a/registry/__index__.tsx
+++ b/registry/__index__.tsx
@@ -38,6 +38,7 @@ import { matrixDecodeConfig } from "@/registry/remocn/matrix-decode/config";
import { microScaleFadeConfig } from "@/registry/remocn/micro-scale-fade/config";
import { numberWheelConfig } from "@/registry/remocn/number-wheel/config";
import { opencodeConfig } from "@/registry/remocn/opencode/config";
+import { paperWobbleConfig } from "@/registry/remocn/paper-wobble/config";
import { perCharacterRiseConfig } from "@/registry/remocn/per-character-rise/config";
import { perWordCrossfadeConfig } from "@/registry/remocn/per-word-crossfade/config";
import { perlinDissolveConfig } from "@/registry/remocn/perlin-dissolve/config";
@@ -1531,6 +1532,13 @@ const registry: Record<string, RegistryEntry> = {
})),
config: confettiConfig,
},
+ "paper-wobble": {
+ load: () =>
+ import("@/components/docs/examples/paper-wobble-example").then((m) => ({
+ default: m.PaperWobbleExampleScene,
+ })),
+ config: paperWobbleConfig,
+ },
backdrop: {
load: () =>
import("@/components/docs/examples/backdrop-demo").then((m) => ({
diff --git a/registry/remocn/paper-wobble/config.ts b/registry/remocn/paper-wobble/config.ts
new file mode 100644
index 00000000..a2c1316d
--- /dev/null
+++ b/registry/remocn/paper-wobble/config.ts
@@ -0,0 +1,40 @@
+import { paperWobbleExampleCode } from "@/components/docs/examples/paper-wobble-example";
+import { type ComponentConfig, FPS, H, W } from "@/lib/customizer-config";
+
+export const paperWobbleConfig: ComponentConfig = {
+ componentName: "PaperWobble",
+ importPath: "@/components/remocn/paper-wobble",
+ controls: {
+ amp: {
+ type: "number",
+ default: 1.4,
+ min: 0,
+ max: 6,
+ step: 0.1,
+ label: "Offset",
+ },
+ rotAmp: {
+ type: "number",
+ default: 0.35,
+ min: 0,
+ max: 2,
+ step: 0.05,
+ label: "Rotation",
+ },
+ seed: { type: "text", default: "wobble", label: "Seed" },
+ step: {
+ type: "number",
+ default: 3,
+ min: 1,
+ max: 6,
+ step: 1,
+ label: "Frames / pose",
+ },
+ },
+ snippet: paperWobbleExampleCode,
+ durationInFrames: 90,
+ fps: FPS,
+ compositionWidth: W,
+ compositionHeight: H,
+ previewBackdrop: { type: "color", value: "#f1eee7" },
+};
diff --git a/registry/remocn/paper-wobble/index.tsx b/registry/remocn/paper-wobble/index.tsx
new file mode 100644
index 00000000..5ab27925
--- /dev/null
+++ b/registry/remocn/paper-wobble/index.tsx
@@ -0,0 +1,42 @@
+"use client";
+
+import type React from "react";
+import { useCurrentFrame } from "remotion";
+import { DEFAULT_STEP, paperJitter } from "@/lib/remocn/stop-motion";
+
+export interface PaperWobbleProps {
+ children: React.ReactNode;
+ seed?: string;
+ amp?: number;
+ rotAmp?: number;
+ step?: number;
+ className?: string;
+ style?: React.CSSProperties;
+}
+
+export function PaperWobble({
+ children,
+ seed = "wobble",
+ amp = 1.4,
+ rotAmp = 0.35,
+ step = DEFAULT_STEP,
+ className,
+ style,
+}: PaperWobbleProps) {
+ const frame = useCurrentFrame();
+ const jitter = paperJitter(frame, seed, { amp, rotAmp, step });
+ const wobble = `translate(${jitter.x}px, ${jitter.y}px) rotate(${jitter.rot}deg)`;
+
+ return (
+ <div
+ className={className}
+ style={{
+ display: "inline-block",
+ ...style,
+ transform: style?.transform ? `${style.transform} ${wobble}` : wobble,
+ }}
+ >
+ {children}
+ </div>
+ );
+}
diff --git a/registry/remocn/registry.json b/registry/remocn/registry.json
index e2f71795..e2ccbca3 100644
--- a/registry/remocn/registry.json
+++ b/registry/remocn/registry.json
@@ -1313,6 +1313,21 @@
}
]
},
+ {
+ "name": "paper-wobble",
+ "type": "registry:component",
+ "title": "Paper Wobble",
+ "description": "Per-pose reshoot jitter that makes any content feel hand-placed on a desk.",
+ "dependencies": ["remotion"],
+ "registryDependencies": ["@remocn/stop-motion"],
+ "files": [
+ {
+ "path": "paper-wobble/index.tsx",
+ "type": "registry:component",
+ "target": "components/remocn/paper-wobble.tsx"
+ }
+ ]
+ },
{
"name": "stop-motion",
"type": "registry:lib",