Production-ready animations, transitions, backgrounds, and scenes for Remotion
TypeScript ai-agentsclaude-codedemo-videomcpmcp-servermodel-context-protocolmotion-designproduct-demoreactremotionshadcnvideo
feat: icon loading
dev_wandryf105b936d012
diff --git a/components/docs/icons-gallery.tsx b/components/docs/icons-gallery.tsxindex f52d25e1..3f5203f2 100644--- a/components/docs/icons-gallery.tsx+++ b/components/docs/icons-gallery.tsx@@ -11,6 +11,7 @@ import { AlertTriangleIconStatic } from "@/registry/remocn/icon-alert-triangle";import { CheckCircleIconStatic } from "@/registry/remocn/icon-check-circle";import { CheckIconStatic } from "@/registry/remocn/icon-check";import { InfoIconStatic } from "@/registry/remocn/icon-info";+import { LoaderIconStatic } from "@/registry/remocn/icon-loader";import { XIconStatic } from "@/registry/remocn/icon-x";export type IconCategory =@@ -61,6 +62,12 @@ export const ICONS: IconEntry[] = [category: "Status & feedback",Static: InfoIconStatic,},+ {+ name: "icon-loader",+ label: "Loader",+ category: "Status & feedback",+ Static: LoaderIconStatic,+ },];const CATEGORY_ORDER: IconCategory[] = [diff --git a/registry/__index__.tsx b/registry/__index__.tsxindex a21b5a7b..d99a6dd5 100644--- a/registry/__index__.tsx+++ b/registry/__index__.tsx@@ -28,6 +28,7 @@ import { iconAlertTriangleConfig } from "@/registry/remocn/icon-alert-triangle/cimport { iconCheckCircleConfig } from "@/registry/remocn/icon-check-circle/config";import { iconCheckConfig } from "@/registry/remocn/icon-check/config";import { iconInfoConfig } from "@/registry/remocn/icon-info/config";+import { iconLoaderConfig } from "@/registry/remocn/icon-loader/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";@@ -583,6 +584,13 @@ const registry: Record<string, RegistryEntry> = {})),config: iconInfoConfig,},+ "icon-loader": {+ load: () =>+ import("@/registry/remocn/icon-loader").then((m) => ({+ default: m.LoaderIcon,+ })),+ config: iconLoaderConfig,+ },"icon-check-circle": {load: () =>import("@/registry/remocn/icon-check-circle").then((m) => ({diff --git a/registry/remocn/icon-loader/config.ts b/registry/remocn/icon-loader/config.tsnew file mode 100644index 00000000..1c705e50--- /dev/null+++ b/registry/remocn/icon-loader/config.ts@@ -0,0 +1,44 @@+import { type ComponentConfig, FPS } from "@/lib/customizer-config";++export const iconLoaderConfig: ComponentConfig = {+ componentName: "LoaderIcon",+ importPath: "@/components/remocn/icon-loader",+ controls: {+ animation: {+ type: "select",+ default: "both",+ options: ["draw", "action", "both"],+ label: "Animation",+ },+ loop: {+ type: "boolean",+ default: true,+ 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: 90,+ fps: FPS,+ compositionWidth: 48,+ compositionHeight: 48,+};diff --git a/registry/remocn/icon-loader/index.tsx b/registry/remocn/icon-loader/index.tsxnew file mode 100644index 00000000..0a7fef75--- /dev/null+++ b/registry/remocn/icon-loader/index.tsx@@ -0,0 +1,101 @@+"use client";++import { Easing, interpolate } from "remotion";+import {+ drawnPathProps,+ type IconAnimationProps,+ useIconAnimation,+} from "@/lib/remocn-icons";++const ARC_PATH = "M21 12a9 9 0 1 1-6.219-8.56";++const TIMINGS = {+ drawDurationInFrames: 10,+ actionDelayInFrames: 2,+ actionDurationInFrames: 40,+ loop: true,+} as const;++export function LoaderIcon({+ animation = "both",+ loop,+ speed,+ size = 48,+ color = "currentColor",+ strokeWidth = 2,+ className,+}: IconAnimationProps) {+ const { drawProgress, actionProgress, cycleIndex } = useIconAnimation(+ { animation, loop, speed },+ TIMINGS,+ );++ const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);++ const arcProgress = interpolate(linearDraw, [0, 1], [0, 1], {+ extrapolateLeft: "clamp",+ extrapolateRight: "clamp",+ easing: Easing.inOut(Easing.quad),+ });+ const entrance = interpolate(linearDraw, [0, 1], [0.9, 1], {+ extrapolateLeft: "clamp",+ extrapolateRight: "clamp",+ easing: Easing.out(Easing.quad),+ });++ const arc = drawnPathProps(ARC_PATH, arcProgress);+ const rotate = (cycleIndex + actionProgress) * 360;++ 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(${entrance})`,+ }}+ >+ <path+ d={ARC_PATH}+ strokeDasharray={arc.strokeDasharray}+ strokeDashoffset={arc.strokeDashoffset}+ />+ </svg>+ );+}++export function LoaderIconStatic({+ 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={ARC_PATH} />+ </svg>+ );+}diff --git a/registry/remocn/registry.json b/registry/remocn/registry.jsonindex d5bb2972..84f9d93e 100644--- a/registry/remocn/registry.json+++ b/registry/remocn/registry.json@@ -1413,6 +1413,21 @@"target": "components/remocn/icon-info.tsx"}]+ },+ {+ "name": "icon-loader",+ "type": "registry:component",+ "title": "Loader",+ "description": "Animated Lucide loader-circle icon — the arc draws on, then spins continuously for a loading or processing beat. Loops by default.",+ "dependencies": ["remotion"],+ "registryDependencies": ["@remocn/icons-core"],+ "files": [+ {+ "path": "icon-loader/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/icon-loader.tsx"+ }+ ]}]}