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-code",
"title": "Code",
"description": "Animated Lucide code icon — the angle brackets draw on, pull apart, and snap back around their code.",
"dependencies": ["remotion"],
"registryDependencies": ["@remocn/icons-core"],
"files": [
{
"path": "registry/remocn-icons/icon-code/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 RIGHT_PATH = \"M16 18 22 12 16 6\";\nconst LEFT_PATH = \"M8 6 2 12 8 18\";\n\nconst TIMINGS = {\n drawDurationInFrames: 12,\n actionDelayInFrames: 2,\n actionDurationInFrames: 22,\n loop: false,\n} as const;\n\nexport function CodeIcon({\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 acting = animation !== \"draw\" && actionFrame >= 0;\n\n const open = acting\n ? interpolate(actionProgress, [0, 0.4, 1], [0, 2.5, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n const pop = acting\n ? interpolate(actionProgress, [0.4, 0.7, 1], [1, 1.04, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n\n const right = drawnPathProps(RIGHT_PATH, drawProgress);\n const left = drawnPathProps(LEFT_PATH, drawProgress);\n\n const scale = (0.85 + 0.15 * scaleIn) * pop;\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={`translate(${open} 0)`}>\n <path\n d={RIGHT_PATH}\n strokeDasharray={right.strokeDasharray}\n strokeDashoffset={right.strokeDashoffset}\n />\n </g>\n <g transform={`translate(${-open} 0)`}>\n <path\n d={LEFT_PATH}\n strokeDasharray={left.strokeDasharray}\n strokeDashoffset={left.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nexport function CodeIconStatic({\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=\"m16 18 6-6-6-6\" />\n <path d=\"m8 6-6 6 6 6\" />\n </svg>\n );\n}\n",
"type": "registry:component",
"target": "components/remocn/icon-code.tsx"
}
],
"type": "registry:component"
}