Skip to content

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

feat: icons x

dev_wandry094adbcd19e7
diff --git a/components/docs/icons-gallery.tsx b/components/docs/icons-gallery.tsx
index c22b0e86..7b892fd8 100644
--- a/components/docs/icons-gallery.tsx
+++ b/components/docs/icons-gallery.tsx
@@ -9,6 +9,7 @@ import { cn } from "@/lib/utils";
import registry, { type RegistryEntry } from "@/registry/__index__";
import { CheckCircleIconStatic } from "@/registry/remocn/icon-check-circle";
import { CheckIconStatic } from "@/registry/remocn/icon-check";
+import { XIconStatic } from "@/registry/remocn/icon-x";
export type IconCategory =
| "Status & feedback"
@@ -40,6 +41,12 @@ export const ICONS: IconEntry[] = [
category: "Status & feedback",
Static: CheckCircleIconStatic,
},
+ {
+ name: "icon-x",
+ label: "X",
+ category: "Status & feedback",
+ Static: XIconStatic,
+ },
];
const CATEGORY_ORDER: IconCategory[] = [
diff --git a/registry/__index__.tsx b/registry/__index__.tsx
index 25ab0151..ac14a952 100644
--- a/registry/__index__.tsx
+++ b/registry/__index__.tsx
@@ -26,6 +26,7 @@ import { glassCodeWalkConfig } from "@/registry/remocn/glass-code-walk/config";
import { grainDissolveConfig } from "@/registry/remocn/grain-dissolve/config";
import { iconCheckCircleConfig } from "@/registry/remocn/icon-check-circle/config";
import { iconCheckConfig } from "@/registry/remocn/icon-check/config";
+import { iconXConfig } from "@/registry/remocn/icon-x/config";
import { infiniteBentoPanConfig } from "@/registry/remocn/infinite-bento-pan/config";
import { infiniteMarqueeConfig } from "@/registry/remocn/infinite-marquee/config";
import { inlineHighlightConfig } from "@/registry/remocn/inline-highlight/config";
@@ -573,6 +574,13 @@ const registry: Record<string, RegistryEntry> = {
})),
config: iconCheckCircleConfig,
},
+ "icon-x": {
+ load: () =>
+ import("@/registry/remocn/icon-x").then((m) => ({
+ default: m.XIcon,
+ })),
+ config: iconXConfig,
+ },
"wave-wipe": {
load: () =>
import("@/components/docs/examples/wave-wipe-example").then((m) => ({
diff --git a/registry/remocn/icon-x/config.ts b/registry/remocn/icon-x/config.ts
new file mode 100644
index 00000000..ad672a3e
--- /dev/null
+++ b/registry/remocn/icon-x/config.ts
@@ -0,0 +1,44 @@
+import { type ComponentConfig, FPS } from "@/lib/customizer-config";
+
+export const iconXConfig: ComponentConfig = {
+ componentName: "XIcon",
+ importPath: "@/components/remocn/icon-x",
+ 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: 60,
+ fps: FPS,
+ compositionWidth: 48,
+ compositionHeight: 48,
+};
diff --git a/registry/remocn/icon-x/index.tsx b/registry/remocn/icon-x/index.tsx
new file mode 100644
index 00000000..3500f52a
--- /dev/null
+++ b/registry/remocn/icon-x/index.tsx
@@ -0,0 +1,116 @@
+"use client";
+
+import { Easing, interpolate } from "remotion";
+import {
+ drawnPathProps,
+ type IconAnimationProps,
+ useIconAnimation,
+} from "@/lib/remocn-icons";
+
+const FIRST_PATH = "M18 6 6 18";
+const SECOND_PATH = "M6 6 18 18";
+
+const TIMINGS = {
+ drawDurationInFrames: 14,
+ actionDelayInFrames: 2,
+ actionDurationInFrames: 18,
+ loop: false,
+} as const;
+
+export function XIcon({
+ animation = "both",
+ loop,
+ speed,
+ size = 48,
+ color = "currentColor",
+ strokeWidth = 2,
+ className,
+}: IconAnimationProps) {
+ const { drawProgress, scaleIn, actionProgress } = useIconAnimation(
+ { animation, loop, speed },
+ TIMINGS,
+ );
+
+ const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);
+
+ const firstProgress = interpolate(linearDraw, [0, 0.57], [0, 1], {
+ extrapolateLeft: "clamp",
+ extrapolateRight: "clamp",
+ easing: Easing.inOut(Easing.quad),
+ });
+ const secondProgress = interpolate(linearDraw, [0.29, 0.86], [0, 1], {
+ extrapolateLeft: "clamp",
+ extrapolateRight: "clamp",
+ easing: Easing.inOut(Easing.quad),
+ });
+
+ const first = drawnPathProps(FIRST_PATH, firstProgress);
+ const second = drawnPathProps(SECOND_PATH, secondProgress);
+
+ const rotate = interpolate(
+ actionProgress,
+ [0, 0.25, 0.5, 0.75, 1],
+ [0, -8, 6, -3, 0],
+ { extrapolateLeft: "clamp", extrapolateRight: "clamp" },
+ );
+ 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: `rotate(${rotate}deg) scale(${scale})`,
+ }}
+ >
+ <path
+ d={FIRST_PATH}
+ strokeDasharray={first.strokeDasharray}
+ strokeDashoffset={first.strokeDashoffset}
+ />
+ <path
+ d={SECOND_PATH}
+ strokeDasharray={second.strokeDasharray}
+ strokeDashoffset={second.strokeDashoffset}
+ />
+ </svg>
+ );
+}
+
+export function XIconStatic({
+ 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={FIRST_PATH} />
+ <path d={SECOND_PATH} />
+ </svg>
+ );
+}
diff --git a/registry/remocn/registry.json b/registry/remocn/registry.json
index 7374a023..43334f70 100644
--- a/registry/remocn/registry.json
+++ b/registry/remocn/registry.json
@@ -1368,6 +1368,21 @@
"target": "components/remocn/icon-check-circle.tsx"
}
]
+ },
+ {
+ "name": "icon-x",
+ "type": "registry:component",
+ "title": "X",
+ "description": "Animated Lucide x icon — the two diagonals draw in crosswise, then the mark shakes to punctuate an error, removal, or dismissal.",
+ "dependencies": ["remotion"],
+ "registryDependencies": ["@remocn/icons-core"],
+ "files": [
+ {
+ "path": "icon-x/index.tsx",
+ "type": "registry:component",
+ "target": "components/remocn/icon-x.tsx"
+ }
+ ]
}
]
}