Skip to content

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

feat: icon key

dev_wandry1b9da49de6e3
diff --git a/components/docs/icons-gallery.tsx b/components/docs/icons-gallery.tsx
index 59fee403..ce80a5eb 100644
--- a/components/docs/icons-gallery.tsx
+++ b/components/docs/icons-gallery.tsx
@@ -32,6 +32,7 @@ import { FlameIconStatic } from "@/registry/remocn/icon-flame";
import { HeartIconStatic } from "@/registry/remocn/icon-heart";
import { ImageIconStatic } from "@/registry/remocn/icon-image";
import { InfoIconStatic } from "@/registry/remocn/icon-info";
+import { KeyIconStatic } from "@/registry/remocn/icon-key";
import { LayoutGridIconStatic } from "@/registry/remocn/icon-layout-grid";
import { LinkIconStatic } from "@/registry/remocn/icon-link";
import { LoaderIconStatic } from "@/registry/remocn/icon-loader";
@@ -262,6 +263,12 @@ export const ICONS: IconEntry[] = [
category: "Actions & UI",
Static: LockIconStatic,
},
+ {
+ name: "icon-key",
+ label: "Key",
+ category: "Actions & UI",
+ Static: KeyIconStatic,
+ },
{
name: "icon-play",
label: "Play",
diff --git a/registry/__index__.tsx b/registry/__index__.tsx
index d43015bd..05aaef27 100644
--- a/registry/__index__.tsx
+++ b/registry/__index__.tsx
@@ -48,6 +48,7 @@ import { iconFlameConfig } from "@/registry/remocn/icon-flame/config";
import { iconHeartConfig } from "@/registry/remocn/icon-heart/config";
import { iconImageConfig } from "@/registry/remocn/icon-image/config";
import { iconInfoConfig } from "@/registry/remocn/icon-info/config";
+import { iconKeyConfig } from "@/registry/remocn/icon-key/config";
import { iconLayoutGridConfig } from "@/registry/remocn/icon-layout-grid/config";
import { iconLinkConfig } from "@/registry/remocn/icon-link/config";
import { iconLoaderConfig } from "@/registry/remocn/icon-loader/config";
@@ -772,6 +773,13 @@ const registry: Record<string, RegistryEntry> = {
})),
config: iconInfoConfig,
},
+ "icon-key": {
+ load: () =>
+ import("@/registry/remocn/icon-key").then((m) => ({
+ default: m.KeyIcon,
+ })),
+ config: iconKeyConfig,
+ },
"icon-layout-grid": {
load: () =>
import("@/registry/remocn/icon-layout-grid").then((m) => ({
diff --git a/registry/remocn/icon-key/config.ts b/registry/remocn/icon-key/config.ts
new file mode 100644
index 00000000..49f280b8
--- /dev/null
+++ b/registry/remocn/icon-key/config.ts
@@ -0,0 +1,44 @@
+import { type ComponentConfig, FPS } from "@/lib/customizer-config";
+
+export const iconKeyConfig: ComponentConfig = {
+ componentName: "KeyIcon",
+ importPath: "@/components/remocn/icon-key",
+ controls: {
+ animation: {
+ type: "select",
+ default: "both",
+ options: ["draw", "action", "both"],
+ label: "Animation",
+ },
+ loop: {
+ type: "boolean",
+ default: false,
+ label: "Loop",
+ },
+ size: {
+ type: "number",
+ default: 48,
+ min: 24,
+ max: 200,
+ step: 4,
+ label: "Size",
+ },
+ color: {
+ type: "color",
+ default: "#171717",
+ label: "Color",
+ },
+ strokeWidth: {
+ type: "number",
+ default: 2,
+ min: 1,
+ max: 3,
+ step: 0.25,
+ label: "Stroke width",
+ },
+ },
+ durationInFrames: 75,
+ fps: FPS,
+ compositionWidth: 48,
+ compositionHeight: 48,
+};
diff --git a/registry/remocn/icon-key/index.tsx b/registry/remocn/icon-key/index.tsx
new file mode 100644
index 00000000..9bc9f0d9
--- /dev/null
+++ b/registry/remocn/icon-key/index.tsx
@@ -0,0 +1,134 @@
+"use client";
+
+import { Easing, interpolate } from "remotion";
+import {
+ drawnPathProps,
+ type IconAnimationProps,
+ useIconAnimation,
+} from "@/lib/remocn-icons";
+
+const HEAD_PATH =
+ "M7.5 10 A5.5 5.5 0 0 1 13 15.5 A5.5 5.5 0 0 1 7.5 21 A5.5 5.5 0 0 1 2 15.5 A5.5 5.5 0 0 1 7.5 10";
+const SHAFT_PATH = "M21 2 11.4 11.6";
+const TEETH_PATH =
+ "m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4";
+
+const TIMINGS = {
+ drawDurationInFrames: 16,
+ actionDelayInFrames: 2,
+ actionDurationInFrames: 28,
+ loop: false,
+} as const;
+
+export function KeyIcon({
+ animation = "both",
+ loop,
+ speed,
+ size = 48,
+ color = "currentColor",
+ strokeWidth = 2,
+ className,
+}: IconAnimationProps) {
+ const { drawProgress, scaleIn, actionProgress, actionFrame } =
+ useIconAnimation({ animation, loop, speed }, TIMINGS);
+
+ const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);
+ const acting = animation !== "draw" && actionFrame >= 0;
+
+ const headDraw = interpolate(linearDraw, [0, 0.625], [0, 1], {
+ extrapolateLeft: "clamp",
+ extrapolateRight: "clamp",
+ easing: Easing.out(Easing.quad),
+ });
+ const shaftDraw = interpolate(linearDraw, [0.375, 0.8], [0, 1], {
+ extrapolateLeft: "clamp",
+ extrapolateRight: "clamp",
+ easing: Easing.out(Easing.quad),
+ });
+ const teethDraw = interpolate(linearDraw, [0.56, 1], [0, 1], {
+ extrapolateLeft: "clamp",
+ extrapolateRight: "clamp",
+ easing: Easing.out(Easing.quad),
+ });
+
+ const turn = acting
+ ? interpolate(actionProgress, [0, 0.5, 0.64, 0.9, 1], [0, -25, -25, 2, 0], {
+ extrapolateLeft: "clamp",
+ extrapolateRight: "clamp",
+ easing: Easing.inOut(Easing.quad),
+ })
+ : 0;
+
+ const head = drawnPathProps(HEAD_PATH, headDraw);
+ const shaft = drawnPathProps(SHAFT_PATH, shaftDraw);
+ const teeth = drawnPathProps(TEETH_PATH, teethDraw);
+
+ const scale = 0.85 + 0.15 * scaleIn;
+
+ return (
+ <svg
+ className={className}
+ width={size}
+ height={size}
+ viewBox="0 0 24 24"
+ fill="none"
+ stroke={color}
+ strokeWidth={strokeWidth}
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ style={{
+ overflow: "visible",
+ transformOrigin: "center",
+ transform: `scale(${scale})`,
+ }}
+ >
+ <g transform={`rotate(${turn} 7.5 15.5)`}>
+ <path
+ d={HEAD_PATH}
+ strokeDasharray={head.strokeDasharray}
+ strokeDashoffset={head.strokeDashoffset}
+ />
+ <path
+ d={SHAFT_PATH}
+ strokeDasharray={shaft.strokeDasharray}
+ strokeDashoffset={shaft.strokeDashoffset}
+ />
+ <path
+ d={TEETH_PATH}
+ strokeDasharray={teeth.strokeDasharray}
+ strokeDashoffset={teeth.strokeDashoffset}
+ />
+ </g>
+ </svg>
+ );
+}
+
+export function KeyIconStatic({
+ size = 48,
+ color = "currentColor",
+ strokeWidth = 2,
+ className,
+}: {
+ size?: number;
+ color?: string;
+ strokeWidth?: number;
+ className?: string;
+}) {
+ return (
+ <svg
+ className={className}
+ width={size}
+ height={size}
+ viewBox="0 0 24 24"
+ fill="none"
+ stroke={color}
+ strokeWidth={strokeWidth}
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ >
+ <path d={TEETH_PATH} />
+ <path d={SHAFT_PATH} />
+ <circle cx="7.5" cy="15.5" r="5.5" />
+ </svg>
+ );
+}
diff --git a/registry/remocn/registry.json b/registry/remocn/registry.json
index 5821f80f..c7c792cb 100644
--- a/registry/remocn/registry.json
+++ b/registry/remocn/registry.json
@@ -2104,6 +2104,21 @@
}
]
},
+ {
+ "name": "icon-key",
+ "type": "registry:component",
+ "title": "Key",
+ "description": "Animated Lucide key icon — draws on, then turns in an invisible lock and springs back.",
+ "dependencies": ["remotion"],
+ "registryDependencies": ["@remocn/icons-core"],
+ "files": [
+ {
+ "path": "icon-key/index.tsx",
+ "type": "registry:component",
+ "target": "components/remocn/icon-key.tsx"
+ }
+ ]
+ },
{
"name": "icon-sparkles",
"type": "registry:component",