Skip to content

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

feat: paper sticker

kapishdimaadfde4ccdbe8
diff --git a/components/docs/examples/paper-sticker-example.tsx b/components/docs/examples/paper-sticker-example.tsx
new file mode 100644
index 00000000..6abdd253
--- /dev/null
+++ b/components/docs/examples/paper-sticker-example.tsx
@@ -0,0 +1,90 @@
+"use client";
+
+import { AbsoluteFill } from "remotion";
+import { PaperSticker } from "@/registry/remocn/paper-sticker";
+
+const MONO_FONT =
+ "var(--font-geist-mono), ui-monospace, SFMono-Regular, Menlo, monospace";
+
+const LABELS = ["remotion", "shadcn", "bun", "biome", "typescript"];
+
+const STAGGER = 6;
+
+export function PaperStickerExampleScene({
+ at = 0,
+ padding,
+ background,
+ maxTilt,
+ seed = "sticker",
+ step,
+}: {
+ at?: number;
+ padding?: string;
+ background?: string;
+ maxTilt?: number;
+ seed?: string;
+ step?: number;
+}) {
+ return (
+ <AbsoluteFill
+ style={{
+ alignItems: "center",
+ justifyContent: "center",
+ flexWrap: "wrap",
+ flexDirection: "row",
+ gap: 24,
+ padding: 120,
+ }}
+ >
+ {LABELS.map((label, i) => (
+ <PaperSticker
+ key={label}
+ at={at + i * STAGGER}
+ seed={`${seed}:${label}`}
+ padding={padding}
+ background={background}
+ maxTilt={maxTilt}
+ step={step}
+ >
+ <span
+ style={{ fontFamily: MONO_FONT, fontSize: 28, color: "#26242c" }}
+ >
+ {label}
+ </span>
+ </PaperSticker>
+ ))}
+ </AbsoluteFill>
+ );
+}
+
+export const paperStickerExampleCode = (
+ values: Record<string, unknown>,
+): string => {
+ const at = (values.at as number) ?? 0;
+ const padding = (values.padding as string) ?? "10px 16px";
+ const background = (values.background as string) ?? "#fbfaf6";
+ const maxTilt = (values.maxTilt as number) ?? 2.6;
+ const seed = (values.seed as string) ?? "sticker";
+ const step = (values.step as number) ?? 3;
+ return `import { PaperSticker } from "@/components/remocn/paper-sticker";
+
+const labels = ${JSON.stringify(LABELS)};
+
+export const MyScene = () => (
+ <>
+ {labels.map((label, i) => (
+ <PaperSticker
+ key={label}
+ at={${at} + i * ${STAGGER}}
+ seed={\`${seed}:\${label}\`}
+ padding="${padding}"
+ background="${background}"
+ maxTilt={${maxTilt}}
+ step={${step}}
+ >
+ <span style={{ fontFamily: "monospace", fontSize: 28 }}>{label}</span>
+ </PaperSticker>
+ ))}
+ </>
+);`;
+};
diff --git a/content/docs/components.mdx b/content/docs/components.mdx
index d4704e42..01e0d961 100644
--- a/content/docs/components.mdx
+++ b/content/docs/components.mdx
@@ -344,6 +344,19 @@ Pre-assembled interface elements: code editors, layouts, charts, and workflow vi
]}
/>
+### Paper & Scrapbook
+
+<ComponentCardGrid
+ items={[
+ {
+ name: "PaperSticker",
+ description: "A taped paper chip that slaps onto the scene over two stop-motion poses",
+ status: "stable",
+ href: "/docs/ui-blocks/paper-sticker",
+ },
+ ]}
+/>
+
## Transitions
Scene transitions, camera moves, and stylized wipes.
diff --git a/content/docs/ui-blocks/meta.json b/content/docs/ui-blocks/meta.json
index c68d8b1d..c8a42bd3 100644
--- a/content/docs/ui-blocks/meta.json
+++ b/content/docs/ui-blocks/meta.json
@@ -8,6 +8,7 @@
"terminal-simulator",
"terminal-cursor-zoom",
"animated-line-chart",
- "animated-bar-chart"
+ "animated-bar-chart",
+ "paper-sticker"
]
}
diff --git a/content/docs/ui-blocks/paper-sticker.mdx b/content/docs/ui-blocks/paper-sticker.mdx
new file mode 100644
index 00000000..23faa95e
--- /dev/null
+++ b/content/docs/ui-blocks/paper-sticker.mdx
@@ -0,0 +1,123 @@
+---
+title: Paper Sticker
+description: A taped paper chip that slaps onto the scene over two stop-motion poses
+---
+
+<ComponentPreview name="paper-sticker" />
+
+## Installation
+
+<InstallBlock name="paper-sticker" />
+
+## Usage
+
+The sticker is not rendered at all until the first pose after `at`. It then
+slaps down over two poses — landing oversized on the first, settling on the
+second — so with the default `step` of 3 an `at` of 6 means the chip appears on
+frame 9 and settles on frame 12. It is a container: the font, size and colour
+of the label belong to the children.
+
+```tsx
+// src/Root.tsx
+import { AbsoluteFill, Composition } from "remotion";
+import { PaperSticker } from "@/components/remocn/paper-sticker";
+
+const StickerScene = () => (
+ <AbsoluteFill
+ style={{
+ background: "#f1eee7",
+ alignItems: "center",
+ justifyContent: "center",
+ }}
+ >
+ <PaperSticker at={6}>
+ <span style={{ fontFamily: "monospace", fontSize: 28 }}>remotion</span>
+ </PaperSticker>
+ </AbsoluteFill>
+);
+
+export const RemotionRoot = () => (
+ <Composition
+ id="PaperSticker"
+ component={StickerScene}
+ durationInFrames={90}
+ fps={30}
+ width={1280}
+ height={720}
+ />
+);
+```
+
+Stagger a group by feeding the index into `at`, and give each chip its own
+`seed` so they do not all land at the same angle:
+
+```tsx
+const labels = ["remotion", "shadcn", "bun", "biome"];
+
+<>
+ {labels.map((label, i) => (
+ <PaperSticker key={label} at={i * 6} seed={label}>
+ <span style={{ fontFamily: "monospace", fontSize: 28 }}>{label}</span>
+ </PaperSticker>
+ ))}
+</>;
+```
+
+The tilt is fixed per seed and the per-pose wobble is already built in, so do
+not wrap this in `paper-wobble` — that would shake it twice. `maxTilt={0}` sits
+the chip square if you want a deliberately tidy row.
+
+## Props
+
+<PropsTable
+ rows={[
+ {
+ name: "children",
+ type: "React.ReactNode",
+ required: true,
+ description: "Contents of the chip; styling is yours",
+ },
+ {
+ name: "at",
+ type: "number",
+ default: "0",
+ description: "Local frame the slap starts from; the chip first appears one pose later and settles one pose after that",
+ },
+ {
+ name: "seed",
+ type: "string",
+ default: "\"sticker\"",
+ description: "Seed for the fixed tilt and the wobble — same seed, same placement",
+ },
+ {
+ name: "padding",
+ type: "string",
+ default: "\"10px 16px\"",
+ description: "CSS padding of the chip",
+ },
+ {
+ name: "background",
+ type: "string",
+ default: "\"#fbfaf6\"",
+ description: "Paper colour of the chip",
+ },
+ {
+ name: "borderColor",
+ type: "string",
+ default: "\"rgba(38,36,44,0.55)\"",
+ description: "Colour of the 1px pencil border",
+ },
+ {
+ name: "maxTilt",
+ type: "number",
+ default: "2.6",
+ description: "Largest hand-placed tilt in degrees; 0 sits square",
+ },
+ {
+ name: "step",
+ type: "number",
+ default: "3",
+ description: "Frames per stop-motion pose — the tempo control",
+ },
+ ]}
+/>
diff --git a/registry-artifacts/paper-sticker.json b/registry-artifacts/paper-sticker.json
new file mode 100644
index 00000000..0ef9920c
--- /dev/null
+++ b/registry-artifacts/paper-sticker.json
@@ -0,0 +1,17 @@
+{
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
+ "name": "paper-sticker",
+ "title": "Paper Sticker",
+ "description": "A taped paper chip that slaps onto the scene over two stop-motion poses, keeping a hand-placed tilt and per-pose wobble.",
+ "dependencies": ["remotion"],
+ "registryDependencies": ["@remocn/stop-motion"],
+ "files": [
+ {
+ "path": "registry/remocn/paper-sticker/index.tsx",
+ "content": "\"use client\";\n\nimport type React from \"react\";\nimport { useCurrentFrame } from \"remotion\";\nimport {\n DEFAULT_STEP,\n hashRange,\n paperJitter,\n steppedRamp,\n} from \"@/lib/remocn/stop-motion\";\n\nexport interface PaperStickerProps {\n children: React.ReactNode;\n at?: number;\n seed?: string;\n padding?: string;\n background?: string;\n borderColor?: string;\n maxTilt?: number;\n step?: number;\n}\n\nexport function PaperSticker({\n children,\n at = 0,\n seed = \"sticker\",\n padding = \"10px 16px\",\n background = \"#fbfaf6\",\n borderColor = \"rgba(38,36,44,0.55)\",\n maxTilt = 2.6,\n step = DEFAULT_STEP,\n}: PaperStickerProps) {\n const frame = useCurrentFrame();\n const progress = steppedRamp(frame, at, at + 2 * step, { step });\n if (progress === 0) return null;\n\n const tilt = hashRange(`${seed}:rot`, -maxTilt, maxTilt);\n const jitter = paperJitter(frame, `sticker:${seed}`, {\n amp: 0.7,\n rotAmp: 0.2,\n step,\n });\n\n return (\n <div\n style={{\n display: \"inline-block\",\n padding,\n background,\n border: `1px solid ${borderColor}`,\n borderRadius: 3,\n boxShadow: \"0 2px 5px rgba(38,36,44,0.14)\",\n transform: `translate(${jitter.x}px, ${jitter.y}px) rotate(${tilt + jitter.rot}deg) scale(${progress < 1 ? 1.12 : 1})`,\n }}\n >\n {children}\n </div>\n );\n}\n",
+ "type": "registry:component",
+ "target": "components/remocn/paper-sticker.tsx"
+ }
+ ],
+ "type": "registry:component"
+}
diff --git a/registry-artifacts/registry.json b/registry-artifacts/registry.json
index eda8ea17..d2f098f0 100644
--- a/registry-artifacts/registry.json
+++ b/registry-artifacts/registry.json
@@ -1343,6 +1343,21 @@
],
"type": "registry:component"
},
+ {
+ "name": "paper-sticker",
+ "title": "Paper Sticker",
+ "description": "A taped paper chip that slaps onto the scene over two stop-motion poses, keeping a hand-placed tilt and per-pose wobble.",
+ "dependencies": ["remotion"],
+ "registryDependencies": ["@remocn/stop-motion"],
+ "files": [
+ {
+ "path": "registry/remocn/paper-sticker/index.tsx",
+ "type": "registry:component",
+ "target": "components/remocn/paper-sticker.tsx"
+ }
+ ],
+ "type": "registry:component"
+ },
{
"name": "stop-motion",
"title": "Stop Motion Clock",
diff --git a/registry/__index__.tsx b/registry/__index__.tsx
index 94b7477c..8d30c6c3 100644
--- a/registry/__index__.tsx
+++ b/registry/__index__.tsx
@@ -39,6 +39,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 { paperStickerConfig } from "@/registry/remocn/paper-sticker/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";
@@ -1540,6 +1541,13 @@ const registry: Record<string, RegistryEntry> = {
})),
config: paperWobbleConfig,
},
+ "paper-sticker": {
+ load: () =>
+ import("@/components/docs/examples/paper-sticker-example").then((m) => ({
+ default: m.PaperStickerExampleScene,
+ })),
+ config: paperStickerConfig,
+ },
"ink-arrow": {
load: () =>
import("@/components/docs/examples/ink-arrow-example").then((m) => ({
diff --git a/registry/remocn/paper-sticker/config.ts b/registry/remocn/paper-sticker/config.ts
new file mode 100644
index 00000000..2e76a9ea
--- /dev/null
+++ b/registry/remocn/paper-sticker/config.ts
@@ -0,0 +1,42 @@
+import { paperStickerExampleCode } from "@/components/docs/examples/paper-sticker-example";
+import { type ComponentConfig, FPS, H, W } from "@/lib/customizer-config";
+
+export const paperStickerConfig: ComponentConfig = {
+ componentName: "PaperSticker",
+ importPath: "@/components/remocn/paper-sticker",
+ controls: {
+ at: {
+ type: "number",
+ default: 0,
+ min: 0,
+ max: 60,
+ step: 1,
+ label: "Slap frame",
+ },
+ padding: { type: "text", default: "10px 16px", label: "Padding" },
+ background: { type: "color", default: "#fbfaf6", label: "Paper" },
+ maxTilt: {
+ type: "number",
+ default: 2.6,
+ min: 0,
+ max: 8,
+ step: 0.2,
+ label: "Max tilt",
+ },
+ seed: { type: "text", default: "sticker", label: "Seed" },
+ step: {
+ type: "number",
+ default: 3,
+ min: 1,
+ max: 6,
+ step: 1,
+ label: "Frames / pose",
+ },
+ },
+ snippet: paperStickerExampleCode,
+ durationInFrames: 120,
+ fps: FPS,
+ compositionWidth: W,
+ compositionHeight: H,
+ previewBackdrop: { type: "color", value: "#f1eee7" },
+};
diff --git a/registry/remocn/paper-sticker/index.tsx b/registry/remocn/paper-sticker/index.tsx
new file mode 100644
index 00000000..dcc8b62c
--- /dev/null
+++ b/registry/remocn/paper-sticker/index.tsx
@@ -0,0 +1,59 @@
+"use client";
+
+import type React from "react";
+import { useCurrentFrame } from "remotion";
+import {
+ DEFAULT_STEP,
+ hashRange,
+ paperJitter,
+ steppedRamp,
+} from "@/lib/remocn/stop-motion";
+
+export interface PaperStickerProps {
+ children: React.ReactNode;
+ at?: number;
+ seed?: string;
+ padding?: string;
+ background?: string;
+ borderColor?: string;
+ maxTilt?: number;
+ step?: number;
+}
+
+export function PaperSticker({
+ children,
+ at = 0,
+ seed = "sticker",
+ padding = "10px 16px",
+ background = "#fbfaf6",
+ borderColor = "rgba(38,36,44,0.55)",
+ maxTilt = 2.6,
+ step = DEFAULT_STEP,
+}: PaperStickerProps) {
+ const frame = useCurrentFrame();
+ const progress = steppedRamp(frame, at, at + 2 * step, { step });
+ if (progress === 0) return null;
+
+ const tilt = hashRange(`${seed}:rot`, -maxTilt, maxTilt);
+ const jitter = paperJitter(frame, `sticker:${seed}`, {
+ amp: 0.7,
+ rotAmp: 0.2,
+ step,
+ });
+
+ return (
+ <div
+ style={{
+ display: "inline-block",
+ padding,
+ background,
+ border: `1px solid ${borderColor}`,
+ borderRadius: 3,
+ boxShadow: "0 2px 5px rgba(38,36,44,0.14)",
+ transform: `translate(${jitter.x}px, ${jitter.y}px) rotate(${tilt + jitter.rot}deg) scale(${progress < 1 ? 1.12 : 1})`,
+ }}
+ >
+ {children}
+ </div>
+ );
+}
diff --git a/registry/remocn/registry.json b/registry/remocn/registry.json
index e7990f11..6207fe8a 100644
--- a/registry/remocn/registry.json
+++ b/registry/remocn/registry.json
@@ -1343,6 +1343,21 @@
}
]
},
+ {
+ "name": "paper-sticker",
+ "type": "registry:component",
+ "title": "Paper Sticker",
+ "description": "A taped paper chip that slaps onto the scene over two stop-motion poses, keeping a hand-placed tilt and per-pose wobble.",
+ "dependencies": ["remotion"],
+ "registryDependencies": ["@remocn/stop-motion"],
+ "files": [
+ {
+ "path": "paper-sticker/index.tsx",
+ "type": "registry:component",
+ "target": "components/remocn/paper-sticker.tsx"
+ }
+ ]
+ },
{
"name": "stop-motion",
"type": "registry:lib",