Interactive tag selection component with cloud-style layout and multi-select functionality.
Install
Add it to your project
Run this in a project set up for shadcn/ui. It writes the files and installs the npm packages.
First time: connect the Infinity UI registry
- Create a personal token on your Tokens page.
- Put it in
.env.localasINFINITYUI_TOKEN. - Add the registry to
components.json:
{
"registries": {
"@infinityui": {
"url": "https://infinityui.io/r/{name}.json",
"headers": {
"Authorization": "Bearer ${INFINITYUI_TOKEN}"
}
}
}
}Using Claude Code, Codex, Cursor, Lovable or v0? See CLI & MCP for a setup prompt.
npm packages it adds
- lucide-react
Code
"use client";
import * as React from "react";
import {
TagCloudSelect,
TagCloudOption,
} from "@/registry/ruixenui/tag-cloud-select";
const tagOptions: TagCloudOption[] = [
{ value: "ai", label: "AI", popularity: 95, color: "#ef4444" },
{ value: "nextjs", label: "Next.js", popularity: 85, color: "#3b82f6" },
{ value: "react", label: "React", popularity: 92, color: "#06b6d4" },
{ value: "docker", label: "Docker", popularity: 70, color: "#2563eb" },
{
value: "kubernetes",
label: "Kubernetes",
popularity: 50,
color: "#8b5cf6",
},
{ value: "aws", label: "AWS", popularity: 80, color: "#f59e0b" },
{ value: "sql", label: "SQL", popularity: 60, color: "#10b981" },
{ value: "ml", label: "Machine Learning", popularity: 88, color: "#ec4899" },
{ value: "security", label: "Security", popularity: 40, color: "#f97316" },
{ value: "linux", label: "Linux", popularity: 65, color: "#374151" },
];
export default function DemoTagCloudSelect() {
const [selectedTags, setSelectedTags] = React.useState<string[]>([]);
return (
<div className="p-4 flex flex-col items-center justify-center gap-4 min-h-screen">
<TagCloudSelect
options={tagOptions}
placeholder="Pick your skills..."
onChange={setSelectedTags}
defaultSelected={["react", "aws"]}
minFontSize={12}
maxFontSize={28}
/>
{selectedTags.length > 0 && (
<div>
<p className="font-medium">Selected Tags:</p>
<ul className="list-disc pl-5">
{selectedTags.map((tag) => (
<li key={tag}>{tag}</li>
))}
</ul>
</div>
)}
</div>
);
}
































