Shadcn.io is not affiliated with official shadcn/ui
get_icon
Fetch one icon by library and name. Returns a ready-to-drop React component plus a token-embedded shadcn add install command.
get_icon resolves one icon to a full registry item: a ready-to-use React component (with size / color / strokeWidth props), plus an install command with your token pre-embedded. It's the retrieval companion to search_icons.
When to use it
- The agent has a specific
(library, name)pair (fromsearch_iconsor the user). - You want the React component source, not just the raw SVG.
- You want an install command that lands the icon at
components/icons/{library}-{name}.tsx.
Arguments
| Name | Type | Required | Notes |
|---|---|---|---|
library | string | ✓ | Library ID from search_icons.results[].libraryId (e.g. lucide, heroicons) |
name | string | ✓ | Icon name from search_icons.results[].name (e.g. arrow-right) |
Example prompts
use shadcnio to add a Lucide arrow-right icon to my button componentuse shadcnio to fetch the github brand icon from simple-icons and install ituse shadcnio and show me the source of heroicons magnifying-glassResponse shape
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "lucide-arrow-right",
"type": "registry:ui",
"title": "ArrowRight Icon",
"author": "lucide",
"description": "ArrowRight icon from lucide",
"homepage": "https://www.shadcn.io/icons/lucide",
"files": [
{
"type": "registry:ui",
"path": "lucide-arrow-right.tsx",
"content": "import * as React from \"react\";\n\nexport function ArrowRightIcon({ size = 24, color = \"currentColor\", strokeWidth = 2, className, ...props }) { return <svg ...>…</svg>; }",
"target": "components/icons/lucide-arrow-right.tsx"
}
],
"dependencies": [],
"registryDependencies": [],
"install": "npx shadcn@latest add \"https://www.shadcn.io/r/lucide-arrow-right.json?token=<your-token>\""
}The generated component accepts size, color, strokeWidth, and className props — all optional. Default size: 24, color: "currentColor", strokeWidth: 2. Drop it in and style it like any other React component.
Manual invocation
curl -s -X POST "https://www.shadcn.io/api/mcp?token=YOUR_TOKEN" \
-H "content-type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "get_icon",
"arguments": { "library": "lucide", "name": "arrow-right" }
}
}' | jq -r '.result.content[0].text | fromjson | .install'FAQ
Was this page helpful?
Sign in to leave feedback.
search_icons
Fuzzy icon search across 222+ libraries (~285,000 icons) using PostgreSQL trigram similarity. Typo-tolerant and cross-library by default.
list_tools
List shadcn.io's 280+ browser-only developer utilities — hashing, encoding, image conversion, text, security, math. Returns `{ title, url }` pairs.