Production-ready animations, transitions, backgrounds, and scenes for Remotion
TypeScript ai-agentsclaude-codedemo-videomcpmcp-servermodel-context-protocolmotion-designproduct-demoreactremotionshadcnvideo
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "icon-key",
"title": "Key",
"description": "Animated Lucide key icon — draws on, then turns in an invisible lock and springs back.",
"dependencies": ["remotion"],
"registryDependencies": ["@remocn/icons-core"],
"files": [
{
"path": "registry/remocn-icons/icon-key/index.tsx",
"content": "\"use client\";\n\nimport { Easing, interpolate } from \"remotion\";\nimport {\n drawnPathProps,\n type IconAnimationProps,\n useIconAnimation,\n} from \"@/lib/remocn-icons\";\n\nconst HEAD_PATH =\n \"M7.5 10 A5.5 5.5 0 0 1 13 15.5 A5.5 5.5 0 0 1 7.5 21 A5.5 5.5 0 0 1 2 15.5 A5.5 5.5 0 0 1 7.5 10\";\nconst SHAFT_PATH = \"M21 2 11.4 11.6\";\nconst TEETH_PATH =\n \"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4\";\n\nconst TIMINGS = {\n drawDurationInFrames: 16,\n actionDelayInFrames: 2,\n actionDurationInFrames: 28,\n loop: false,\n} as const;\n\nexport function KeyIcon({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const headDraw = interpolate(linearDraw, [0, 0.625], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const shaftDraw = interpolate(linearDraw, [0.375, 0.8], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const teethDraw = interpolate(linearDraw, [0.56, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const turn = acting\n ? interpolate(actionProgress, [0, 0.5, 0.64, 0.9, 1], [0, -25, -25, 2, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n\n const head = drawnPathProps(HEAD_PATH, headDraw);\n const shaft = drawnPathProps(SHAFT_PATH, shaftDraw);\n const teeth = drawnPathProps(TEETH_PATH, teethDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`rotate(${turn} 7.5 15.5)`}>\n <path\n d={HEAD_PATH}\n strokeDasharray={head.strokeDasharray}\n strokeDashoffset={head.strokeDashoffset}\n />\n <path\n d={SHAFT_PATH}\n strokeDasharray={shaft.strokeDasharray}\n strokeDashoffset={shaft.strokeDashoffset}\n />\n <path\n d={TEETH_PATH}\n strokeDasharray={teeth.strokeDasharray}\n strokeDashoffset={teeth.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nexport function KeyIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={TEETH_PATH} />\n <path d={SHAFT_PATH} />\n <circle cx=\"7.5\" cy=\"15.5\" r=\"5.5\" />\n </svg>\n );\n}\n",
"type": "registry:component",
"target": "components/remocn/icon-key.tsx"
}
],
"type": "registry:component"
}