Skip to content

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

feat: icon pencil

dev_wandryf3e2fbbd11b2
diff --git a/components/docs/icons-gallery.tsx b/components/docs/icons-gallery.tsx
index d0768fda..a8844c98 100644
--- a/components/docs/icons-gallery.tsx
+++ b/components/docs/icons-gallery.tsx
@@ -36,6 +36,7 @@ import { MicIconStatic } from "@/registry/remocn/icon-mic";
import { MoreHorizontalIconStatic } from "@/registry/remocn/icon-more-horizontal";
import { PartyPopperIconStatic } from "@/registry/remocn/icon-party-popper";
import { PauseIconStatic } from "@/registry/remocn/icon-pause";
+import { PencilIconStatic } from "@/registry/remocn/icon-pencil";
import { PlayIconStatic } from "@/registry/remocn/icon-play";
import { PlusIconStatic } from "@/registry/remocn/icon-plus";
import { RefreshCwIconStatic } from "@/registry/remocn/icon-refresh-cw";
@@ -199,6 +200,12 @@ export const ICONS: IconEntry[] = [
category: "Actions & UI",
Static: LayoutGridIconStatic,
},
+ {
+ name: "icon-pencil",
+ label: "Pencil",
+ category: "Actions & UI",
+ Static: PencilIconStatic,
+ },
{
name: "icon-play",
label: "Play",
diff --git a/registry/__index__.tsx b/registry/__index__.tsx
index 2f95c491..8cde3388 100644
--- a/registry/__index__.tsx
+++ b/registry/__index__.tsx
@@ -52,6 +52,7 @@ import { iconMicConfig } from "@/registry/remocn/icon-mic/config";
import { iconMoreHorizontalConfig } from "@/registry/remocn/icon-more-horizontal/config";
import { iconPartyPopperConfig } from "@/registry/remocn/icon-party-popper/config";
import { iconPauseConfig } from "@/registry/remocn/icon-pause/config";
+import { iconPencilConfig } from "@/registry/remocn/icon-pencil/config";
import { iconPlayConfig } from "@/registry/remocn/icon-play/config";
import { iconPlusConfig } from "@/registry/remocn/icon-plus/config";
import { iconRefreshCwConfig } from "@/registry/remocn/icon-refresh-cw/config";
@@ -791,6 +792,13 @@ const registry: Record<string, RegistryEntry> = {
})),
config: iconPauseConfig,
},
+ "icon-pencil": {
+ load: () =>
+ import("@/registry/remocn/icon-pencil").then((m) => ({
+ default: m.PencilIcon,
+ })),
+ config: iconPencilConfig,
+ },
"icon-play": {
load: () =>
import("@/registry/remocn/icon-play").then((m) => ({
diff --git a/registry/remocn/icon-pencil/config.ts b/registry/remocn/icon-pencil/config.ts
new file mode 100644
index 00000000..71fb999a
--- /dev/null
+++ b/registry/remocn/icon-pencil/config.ts
@@ -0,0 +1,44 @@
+import { type ComponentConfig, FPS } from "@/lib/customizer-config";
+
+export const iconPencilConfig: ComponentConfig = {
+ componentName: "PencilIcon",
+ importPath: "@/components/remocn/icon-pencil",
+ 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-pencil/index.tsx b/registry/remocn/icon-pencil/index.tsx
new file mode 100644
index 00000000..392e346e
--- /dev/null
+++ b/registry/remocn/icon-pencil/index.tsx
@@ -0,0 +1,128 @@
+"use client";
+
+import { Easing, interpolate } from "remotion";
+import {
+ drawnPathProps,
+ type IconAnimationProps,
+ useIconAnimation,
+} from "@/lib/remocn-icons";
+
+const BODY_PATH =
+ "M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z";
+const TIP_PATH = "M15 5 19 9";
+
+const TIMINGS = {
+ drawDurationInFrames: 14,
+ actionDelayInFrames: 2,
+ actionDurationInFrames: 24,
+ loop: false,
+} as const;
+
+export function PencilIcon({
+ 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 bodyDraw = interpolate(linearDraw, [0, 0.857], [0, 1], {
+ extrapolateLeft: "clamp",
+ extrapolateRight: "clamp",
+ easing: Easing.out(Easing.quad),
+ });
+ const tipDraw = interpolate(linearDraw, [0.571, 1], [0, 1], {
+ extrapolateLeft: "clamp",
+ extrapolateRight: "clamp",
+ easing: Easing.out(Easing.quad),
+ });
+
+ const acting = animation !== "draw" && actionFrame >= 0;
+
+ const rotate = acting
+ ? interpolate(actionProgress, [0, 0.25, 0.5, 0.75, 1], [0, -6, 4, -2, 0], {
+ extrapolateLeft: "clamp",
+ extrapolateRight: "clamp",
+ easing: Easing.inOut(Easing.quad),
+ })
+ : 0;
+ const nudge = acting
+ ? interpolate(actionProgress, [0, 0.25, 0.5, 0.75, 1], [0, 1, -0.5, 0.5, 0], {
+ extrapolateLeft: "clamp",
+ extrapolateRight: "clamp",
+ easing: Easing.inOut(Easing.quad),
+ })
+ : 0;
+
+ const body = drawnPathProps(BODY_PATH, bodyDraw);
+ const tip = drawnPathProps(TIP_PATH, tipDraw);
+
+ 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(${rotate} 3 21) translate(${nudge} 0)`}>
+ <path
+ d={BODY_PATH}
+ strokeDasharray={body.strokeDasharray}
+ strokeDashoffset={body.strokeDashoffset}
+ />
+ <path
+ d={TIP_PATH}
+ strokeDasharray={tip.strokeDasharray}
+ strokeDashoffset={tip.strokeDashoffset}
+ />
+ </g>
+ </svg>
+ );
+}
+
+export function PencilIconStatic({
+ 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={BODY_PATH} />
+ <path d={TIP_PATH} />
+ </svg>
+ );
+}
diff --git a/registry/remocn/registry.json b/registry/remocn/registry.json
index 8601cda8..3ffd9beb 100644
--- a/registry/remocn/registry.json
+++ b/registry/remocn/registry.json
@@ -1969,6 +1969,21 @@
}
]
},
+ {
+ "name": "icon-pencil",
+ "type": "registry:component",
+ "title": "Pencil",
+ "description": "Animated Lucide pencil icon — draws on, then scribbles: the pencil rocks around its tip as if writing.",
+ "dependencies": ["remotion"],
+ "registryDependencies": ["@remocn/icons-core"],
+ "files": [
+ {
+ "path": "icon-pencil/index.tsx",
+ "type": "registry:component",
+ "target": "components/remocn/icon-pencil.tsx"
+ }
+ ]
+ },
{
"name": "icon-sparkles",
"type": "registry:component",