Skip to content

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

feat: icon code

dev_wandrye839233c4469
diff --git a/components/docs/icons-gallery.tsx b/components/docs/icons-gallery.tsx
index 3103f0fe..86465b31 100644
--- a/components/docs/icons-gallery.tsx
+++ b/components/docs/icons-gallery.tsx
@@ -25,6 +25,7 @@ import { ChevronLeftIconStatic } from "@/registry/remocn/icon-chevron-left";
import { ChevronRightIconStatic } from "@/registry/remocn/icon-chevron-right";
import { ChevronUpIconStatic } from "@/registry/remocn/icon-chevron-up";
import { ClockIconStatic } from "@/registry/remocn/icon-clock";
+import { CodeIconStatic } from "@/registry/remocn/icon-code";
import { CopyIconStatic } from "@/registry/remocn/icon-copy";
import { DownloadIconStatic } from "@/registry/remocn/icon-download";
import { ExternalLinkIconStatic } from "@/registry/remocn/icon-external-link";
@@ -210,6 +211,12 @@ export const ICONS: IconEntry[] = [
category: "Files & dev",
Static: FileTextIconStatic,
},
+ {
+ name: "icon-code",
+ label: "Code",
+ category: "Files & dev",
+ Static: CodeIconStatic,
+ },
{
name: "icon-search",
label: "Search",
diff --git a/registry/__index__.tsx b/registry/__index__.tsx
index b565d5cd..70a1fdf9 100644
--- a/registry/__index__.tsx
+++ b/registry/__index__.tsx
@@ -41,6 +41,7 @@ import { iconChevronLeftConfig } from "@/registry/remocn/icon-chevron-left/confi
import { iconChevronRightConfig } from "@/registry/remocn/icon-chevron-right/config";
import { iconChevronUpConfig } from "@/registry/remocn/icon-chevron-up/config";
import { iconClockConfig } from "@/registry/remocn/icon-clock/config";
+import { iconCodeConfig } from "@/registry/remocn/icon-code/config";
import { iconCopyConfig } from "@/registry/remocn/icon-copy/config";
import { iconDownloadConfig } from "@/registry/remocn/icon-download/config";
import { iconExternalLinkConfig } from "@/registry/remocn/icon-external-link/config";
@@ -743,6 +744,13 @@ const registry: Record<string, RegistryEntry> = {
})),
config: iconClockConfig,
},
+ "icon-code": {
+ load: () =>
+ import("@/registry/remocn/icon-code").then((m) => ({
+ default: m.CodeIcon,
+ })),
+ config: iconCodeConfig,
+ },
"icon-copy": {
load: () =>
import("@/registry/remocn/icon-copy").then((m) => ({
diff --git a/registry/remocn/icon-code/config.ts b/registry/remocn/icon-code/config.ts
new file mode 100644
index 00000000..64ecc037
--- /dev/null
+++ b/registry/remocn/icon-code/config.ts
@@ -0,0 +1,44 @@
+import { type ComponentConfig, FPS } from "@/lib/customizer-config";
+
+export const iconCodeConfig: ComponentConfig = {
+ componentName: "CodeIcon",
+ importPath: "@/components/remocn/icon-code",
+ 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: 70,
+ fps: FPS,
+ compositionWidth: 48,
+ compositionHeight: 48,
+};
diff --git a/registry/remocn/icon-code/index.tsx b/registry/remocn/icon-code/index.tsx
new file mode 100644
index 00000000..4e4f26da
--- /dev/null
+++ b/registry/remocn/icon-code/index.tsx
@@ -0,0 +1,116 @@
+"use client";
+
+import { Easing, interpolate } from "remotion";
+import {
+ drawnPathProps,
+ type IconAnimationProps,
+ useIconAnimation,
+} from "@/lib/remocn-icons";
+
+const RIGHT_PATH = "M16 18 22 12 16 6";
+const LEFT_PATH = "M8 6 2 12 8 18";
+
+const TIMINGS = {
+ drawDurationInFrames: 12,
+ actionDelayInFrames: 2,
+ actionDurationInFrames: 22,
+ loop: false,
+} as const;
+
+export function CodeIcon({
+ animation = "both",
+ loop,
+ speed,
+ size = 48,
+ color = "currentColor",
+ strokeWidth = 2,
+ className,
+}: IconAnimationProps) {
+ const { drawProgress, scaleIn, actionProgress, actionFrame } =
+ useIconAnimation({ animation, loop, speed }, TIMINGS);
+
+ const acting = animation !== "draw" && actionFrame >= 0;
+
+ const open = acting
+ ? interpolate(actionProgress, [0, 0.4, 1], [0, 2.5, 0], {
+ extrapolateLeft: "clamp",
+ extrapolateRight: "clamp",
+ easing: Easing.inOut(Easing.quad),
+ })
+ : 0;
+ const pop = acting
+ ? interpolate(actionProgress, [0.4, 0.7, 1], [1, 1.04, 1], {
+ extrapolateLeft: "clamp",
+ extrapolateRight: "clamp",
+ easing: Easing.inOut(Easing.quad),
+ })
+ : 1;
+
+ const right = drawnPathProps(RIGHT_PATH, drawProgress);
+ const left = drawnPathProps(LEFT_PATH, drawProgress);
+
+ const scale = (0.85 + 0.15 * scaleIn) * pop;
+
+ 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={`translate(${open} 0)`}>
+ <path
+ d={RIGHT_PATH}
+ strokeDasharray={right.strokeDasharray}
+ strokeDashoffset={right.strokeDashoffset}
+ />
+ </g>
+ <g transform={`translate(${-open} 0)`}>
+ <path
+ d={LEFT_PATH}
+ strokeDasharray={left.strokeDasharray}
+ strokeDashoffset={left.strokeDashoffset}
+ />
+ </g>
+ </svg>
+ );
+}
+
+export function CodeIconStatic({
+ 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="m16 18 6-6-6-6" />
+ <path d="m8 6-6 6 6 6" />
+ </svg>
+ );
+}
diff --git a/registry/remocn/registry.json b/registry/remocn/registry.json
index 7df68f25..6bbd3855 100644
--- a/registry/remocn/registry.json
+++ b/registry/remocn/registry.json
@@ -2359,6 +2359,21 @@
}
]
},
+ {
+ "name": "icon-code",
+ "type": "registry:component",
+ "title": "Code",
+ "description": "Animated Lucide code icon — the angle brackets draw on, pull apart, and snap back around their code.",
+ "dependencies": ["remotion"],
+ "registryDependencies": ["@remocn/icons-core"],
+ "files": [
+ {
+ "path": "icon-code/index.tsx",
+ "type": "registry:component",
+ "target": "components/remocn/icon-code.tsx"
+ }
+ ]
+ },
{
"name": "icon-user",
"type": "registry:component",