{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "dynamic-tag-cloud-shadcnui", "type": "registry:ui", "title": "Dynamic Tag Cloud", "description": "Floating cluster of tags that drift and rearrange when hovered", "dependencies": [ "framer-motion", "react" ], "files": [ { "path": "@uitripled/react-shadcn/src/components/motion-core/dynamic-tag-cloud.tsx", "content": "\"use client\";\n\nimport { motion } from \"framer-motion\";\nimport { useState } from \"react\";\n\ntype Tag = {\n id: string;\n label: string;\n};\n\ntype DynamicTagCloudProps = {\n tags?: Tag[];\n};\n\nexport function DynamicTagCloud({\n tags = [\n { id: \"1\", label: \"React\" },\n { id: \"2\", label: \"TypeScript\" },\n { id: \"3\", label: \"Framer Motion\" },\n { id: \"4\", label: \"TailwindCSS\" },\n { id: \"5\", label: \"Next.js\" },\n { id: \"6\", label: \"Design\" },\n ],\n}: DynamicTagCloudProps) {\n const [hoveredId, setHoveredId] = useState(null);\n\n const generateRandomOffset = () => ({\n x: Math.random() * 20 - 10,\n y: Math.random() * 20 - 10,\n });\n\n return (\n
\n
\n {tags.map((tag, index) => {\n const offset = generateRandomOffset();\n const isHovered = hoveredId === tag.id;\n\n return (\n setHoveredId(tag.id)}\n onHoverEnd={() => setHoveredId(null)}\n className=\"rounded-full border border-border bg-muted px-4 py-2 text-sm font-medium transition-colors hover:bg-primary hover:text-primary-foreground\"\n >\n {tag.label}\n \n );\n })}\n
\n
\n );\n}\n", "type": "registry:ui", "target": "components/uitripled/dynamic-tag-cloud-shadcnui.tsx" } ] }