Production-ready animations, transitions, backgrounds, and scenes for Remotion
TypeScript ai-agentsclaude-codedemo-videomcpmcp-servermodel-context-protocolmotion-designproduct-demoreactremotionshadcnvideo
feat: icon search
dev_wandryf65189dd1c8e
diff --git a/components/docs/icons-gallery.tsx b/components/docs/icons-gallery.tsxindex 00e72dab..bde3f475 100644--- a/components/docs/icons-gallery.tsx+++ b/components/docs/icons-gallery.tsx@@ -13,6 +13,7 @@ import { CheckIconStatic } from "@/registry/remocn/icon-check";import { InfoIconStatic } from "@/registry/remocn/icon-info";import { LoaderIconStatic } from "@/registry/remocn/icon-loader";import { RefreshCwIconStatic } from "@/registry/remocn/icon-refresh-cw";+import { SearchIconStatic } from "@/registry/remocn/icon-search";import { XIconStatic } from "@/registry/remocn/icon-x";export type IconCategory =@@ -75,6 +76,12 @@ export const ICONS: IconEntry[] = [category: "Status & feedback",Static: RefreshCwIconStatic,},+ {+ name: "icon-search",+ label: "Search",+ category: "Actions & UI",+ Static: SearchIconStatic,+ },];const CATEGORY_ORDER: IconCategory[] = [@@ -222,19 +229,22 @@ function IconPlayer({ entry }: { entry: RegistryEntry }) {const { config, load } = entry;useEffect(() => {- let raf1 = 0;- let raf2 = 0;- raf1 = requestAnimationFrame(() => {- playerRef.current?.play();- raf2 = requestAnimationFrame(() => {- if (playerRef.current && !playerRef.current.isPlaying()) {- playerRef.current.play();- }- });- });+ let raf = 0;+ let tries = 0;+ let cancelled = false;+ const pump = () => {+ if (cancelled) return;+ const player = playerRef.current;+ if (player && !player.isPlaying()) player.play();+ tries += 1;+ if (tries < 120 && (!player || !player.isPlaying())) {+ raf = requestAnimationFrame(pump);+ }+ };+ raf = requestAnimationFrame(pump);return () => {- if (raf1) cancelAnimationFrame(raf1);- if (raf2) cancelAnimationFrame(raf2);+ cancelled = true;+ cancelAnimationFrame(raf);};}, []);diff --git a/registry/__index__.tsx b/registry/__index__.tsxindex 2e4254bb..727deec2 100644--- a/registry/__index__.tsx+++ b/registry/__index__.tsx@@ -30,6 +30,7 @@ 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 { iconRefreshCwConfig } from "@/registry/remocn/icon-refresh-cw/config";+import { iconSearchConfig } from "@/registry/remocn/icon-search/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";@@ -599,6 +600,13 @@ const registry: Record<string, RegistryEntry> = {})),config: iconRefreshCwConfig,},+ "icon-search": {+ load: () =>+ import("@/registry/remocn/icon-search").then((m) => ({+ default: m.SearchIcon,+ })),+ config: iconSearchConfig,+ },"icon-check-circle": {load: () =>import("@/registry/remocn/icon-check-circle").then((m) => ({diff --git a/registry/remocn/icon-search/config.ts b/registry/remocn/icon-search/config.tsnew file mode 100644index 00000000..0c566f5d--- /dev/null+++ b/registry/remocn/icon-search/config.ts@@ -0,0 +1,44 @@+import { type ComponentConfig, FPS } from "@/lib/customizer-config";++export const iconSearchConfig: ComponentConfig = {+ componentName: "SearchIcon",+ importPath: "@/components/remocn/icon-search",+ 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-search/index.tsx b/registry/remocn/icon-search/index.tsxnew file mode 100644index 00000000..bdfda5f9--- /dev/null+++ b/registry/remocn/icon-search/index.tsx@@ -0,0 +1,118 @@+"use client";++import { Easing, interpolate } from "remotion";+import {+ drawnPathProps,+ type IconAnimationProps,+ useIconAnimation,+} from "@/lib/remocn-icons";++const CIRCLE_PATH =+ "M11 3 A8 8 0 0 1 19 11 A8 8 0 0 1 11 19 A8 8 0 0 1 3 11 A8 8 0 0 1 11 3";+const HANDLE_DRAW = "M16.66 16.66 21 21";+const HANDLE_STATIC = "m21 21-4.34-4.34";++const TIMINGS = {+ drawDurationInFrames: 14,+ actionDelayInFrames: 2,+ actionDurationInFrames: 40,+ loop: false,+} as const;++export function SearchIcon({+ 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 circleProgress = interpolate(linearDraw, [0, 0.857], [0, 1], {+ extrapolateLeft: "clamp",+ extrapolateRight: "clamp",+ easing: Easing.inOut(Easing.quad),+ });+ const handleProgress = interpolate(linearDraw, [0.571, 1], [0, 1], {+ extrapolateLeft: "clamp",+ extrapolateRight: "clamp",+ easing: Easing.out(Easing.quad),+ });++ const circle = drawnPathProps(CIRCLE_PATH, circleProgress);+ const handle = drawnPathProps(HANDLE_DRAW, handleProgress);++ const scanEase = { extrapolateLeft: "clamp", extrapolateRight: "clamp", easing: Easing.inOut(Easing.quad) } as const;+ const scanX = interpolate(actionProgress, [0, 0.25, 0.5, 0.75, 1], [0, -3, 3, -1, 0], scanEase);+ const scanY = interpolate(actionProgress, [0, 0.25, 0.5, 0.75, 1], [0, -2, -1, 2, 0], scanEase);++ 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={`translate(${scanX} ${scanY})`}>+ <path+ d={CIRCLE_PATH}+ strokeDasharray={circle.strokeDasharray}+ strokeDashoffset={circle.strokeDashoffset}+ />+ <path+ d={HANDLE_DRAW}+ strokeDasharray={handle.strokeDasharray}+ strokeDashoffset={handle.strokeDashoffset}+ />+ </g>+ </svg>+ );+}++export function SearchIconStatic({+ 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"+ >+ <circle cx="11" cy="11" r="8" />+ <path d={HANDLE_STATIC} />+ </svg>+ );+}diff --git a/registry/remocn/registry.json b/registry/remocn/registry.jsonindex 3f355834..b96feb97 100644--- a/registry/remocn/registry.json+++ b/registry/remocn/registry.json@@ -1443,6 +1443,21 @@"target": "components/remocn/icon-refresh-cw.tsx"}]+ },+ {+ "name": "icon-search",+ "type": "registry:component",+ "title": "Search",+ "description": "Animated Lucide search icon — the lens draws on, the handle extends, then the magnifier sweeps a small scanning path for a search or discovery beat.",+ "dependencies": ["remotion"],+ "registryDependencies": ["@remocn/icons-core"],+ "files": [+ {+ "path": "icon-search/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/icon-search.tsx"+ }+ ]}]}