unicon
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseUnicon
Unicon
Unicon is a unified icon library providing 19,000+ icons from 9 popular libraries. Unlike traditional npm packages that bundle thousands of icons, Unicon generates only the icons you need.
Unicon是一个统一的图标库,整合了9个流行图标库的19000+款图标。与传统会打包数千个图标的npm包不同,Unicon只会生成你需要的图标。
Quick Start
快速开始
bash
undefinedbash
undefinedInstall CLI globally
全局安装CLI
npm install -g @webrenew/unicon
npm install -g @webrenew/unicon
Or use directly with npx
或直接使用npx
npx @webrenew/unicon search "dashboard"
undefinednpx @webrenew/unicon search "dashboard"
undefinedCore Commands
核心命令
| Command | Description |
|---|---|
| AI-powered semantic search (supports |
| Get single icon to stdout, file, or clipboard ( |
| Show detailed icon information |
| ASCII art preview in terminal |
| Bundle multiple icons (supports |
| Create .uniconrc.json config ( |
| Regenerate bundles ( |
| Add bundle to config |
| Add icon to favorites |
| Find unused/missing icons in project |
| List available icon libraries |
| List icon categories |
| Manage local cache |
| Install AI assistant skills |
| 命令 | 描述 |
|---|---|
| 基于AI的语义搜索(支持 |
| 获取单个图标并输出到标准输出、文件或剪贴板( |
| 显示图标的详细信息 |
| 在终端中以ASCII艺术形式预览图标 |
| 打包多个图标(支持 |
| 创建.uniconrc.json配置文件( |
| 重新生成图标包( |
| 向配置文件中添加图标包 |
| 将图标添加到收藏夹 |
| 查找项目中未使用或缺失的图标 |
| 列出可用的图标源库 |
| 列出图标分类 |
| 管理本地缓存 |
| 安装AI助手技能 |
Output Formats
输出格式
| Format | Extension | Use Case |
|---|---|---|
| | React/Next.js (auto-detected) |
| | Vue 3 SFC (auto-detected) |
| | Svelte components (auto-detected) |
| | Raw SVG markup |
| | Data/programmatic use |
Note: CLI auto-detects your framework from and uses the appropriate format.
package.json| 格式 | 扩展名 | 使用场景 |
|---|---|---|
| | React/Next.js(自动检测) |
| | Vue 3单文件组件(自动检测) |
| | Svelte组件(自动检测) |
| | 原生SVG标记 |
| | 数据/程序化使用 |
注意: CLI会自动从中检测你的框架并使用对应的格式。
package.jsonIcon Sources
图标源库
| Source | Icons | Description |
|---|---|---|
| 1,900+ | Beautiful & consistent |
| 1,500+ | 6 weights available |
| 1,800+ | Modern outlined icons |
| 292 | Tailwind Labs |
| 4,600+ | Pixel-perfect stroke |
| 287 | Simple and clean |
| 2,800+ | Multiple categories |
| 3,300+ | Brand logos |
| 1,600+ | Modern outlined icons |
| 源库 | 图标数量 | 描述 |
|---|---|---|
| 1900+ | 美观且风格统一 |
| 1500+ | 提供6种字重 |
| 1800+ | 现代轮廓风格图标 |
| 292 | Tailwind Labs出品 |
| 4600+ | 像素级完美的线条图标 |
| 287 | 简洁干净 |
| 2800+ | 包含多种分类 |
| 3300+ | 品牌标志 |
| 1600+ | 现代轮廓风格图标 |
Common Workflows
常见工作流程
Add Icons to a React Project
为React项目添加图标
bash
undefinedbash
undefined1. Initialize config (interactive wizard)
1. 初始化配置(交互式向导)
unicon init --interactive
unicon init --interactive
2. Search for icons interactively
2. 交互式搜索图标
unicon search "navigation arrows" --pick
unicon search "navigation arrows" --pick
3. Add bundle to config
3. 向配置中添加图标包
unicon add nav --query "arrow chevron menu"
unicon add nav --query "arrow chevron menu"
4. Generate components
4. 生成组件
unicon sync
unicon sync
5. Import and use
5. 导入并使用
import { ArrowRight, Menu } from "./src/icons/nav"
import { ArrowRight, Menu } from "./src/icons/nav"
undefinedundefinedGet a Single Icon Quickly
快速获取单个图标
bash
undefinedbash
undefinedOutput to stdout (auto-detects framework)
输出到标准输出(自动检测框架)
unicon get home
unicon get home
Copy to clipboard directly
直接复制到剪贴板
unicon get home --copy
unicon get home --copy
Save to file
保存到文件
unicon get settings --format react -o ./Settings.tsx
unicon get settings --format react -o ./Settings.tsx
Different framework
指定其他框架
unicon get home --format vue -o ./Home.vue
undefinedunicon get home --format vue -o ./Home.vue
undefinedInteractive Search with Selection
带选择功能的交互式搜索
bash
undefinedbash
undefinedSearch and pick icons interactively
交互式搜索并选择图标
unicon search "dashboard" --pick
unicon search "dashboard" --pick
Then choose action: copy, save, star, or create bundle
然后选择操作:复制、保存、收藏或创建图标包
undefinedundefinedBundle by Category
按分类打包图标
bash
undefinedbash
undefinedBundle all dashboard icons (tree-shakeable by default)
打包所有仪表板类图标(默认支持Tree-shaking)
unicon bundle --category Dashboards -o ./src/icons
unicon bundle --category Dashboards -o ./src/icons
Bundle specific icons by search
根据搜索结果打包特定图标
unicon bundle --query "social media" --format svg -o ./public/icons
unicon bundle --query "social media" --format svg -o ./public/icons
Bundle all favorited icons
打包所有收藏的图标
unicon bundle --stars -o ./src/icons/favorites
unicon bundle --stars -o ./src/icons/favorites
Single file mode (not tree-shakeable)
单文件模式(不支持Tree-shaking)
unicon bundle --query "ui" --single-file -o ./icons.tsx
undefinedunicon bundle --query "ui" --single-file -o ./icons.tsx
undefinedFavorites System
收藏系统
bash
undefinedbash
undefinedStar icons for later
收藏图标供后续使用
unicon star home
unicon star settings
unicon star user
unicon star home
unicon star settings
unicon star user
Bundle all starred icons
打包所有收藏的图标
unicon bundle --stars -o ./src/icons/favorites
unicon bundle --stars -o ./src/icons/favorites
View favorites
查看收藏列表
unicon favorites
undefinedunicon favorites
undefinedWatch Mode for Development
开发模式下的监听功能
bash
undefinedbash
undefinedAuto-regenerate when config changes
配置文件变更时自动重新生成图标
unicon sync --watch
undefinedunicon sync --watch
undefinedAudit Project Usage
审计项目使用情况
bash
undefinedbash
undefinedFind unused bundled icons and missing imports
查找未使用的打包图标和缺失的导入
unicon audit
undefinedunicon audit
undefinedPreview Icons in Terminal
在终端中预览图标
bash
undefinedbash
undefinedASCII art preview
ASCII艺术形式预览
unicon preview home
unicon preview home
Custom size
自定义尺寸
unicon preview star --width 24
undefinedunicon preview star --width 24
undefinedTree-Shaking Benefits
Tree-shaking优势
Unlike which downloads thousands of icons:
npm install lucide-react- Generates only the icons you need as individual files
- No external dependencies to ship
- True tree-shaking with one component per file
- Import only what you use:
import { Home } from "./icons"
与会下载数千个图标不同:
npm install lucide-react- 仅生成你需要的图标并保存为单独文件
- 无需打包外部依赖
- 单文件对应单个组件,真正支持Tree-shaking
- 仅导入你使用的图标:
import { Home } from "./icons"
Web Interface
Web界面
Browse and copy icons at: https://unicon.sh
- Visual search with AI
- One-click copy (SVG, React, Vue, Svelte)
- Filter by library and category
- Bundle builder for multiple icons
可通过以下地址浏览并复制图标:https://unicon.sh
- 基于AI的可视化搜索
- 一键复制(SVG、React、Vue、Svelte格式)
- 按库和分类筛选
- 多图标打包构建工具
References
参考文档
- CLI Commands - All commands and options
- Config File - schema
.uniconrc.json - API Reference - REST endpoints
- CLI命令 - 所有命令及选项
- 配置文件 - schema
.uniconrc.json - API参考 - REST端点
AI Assistant Integration
AI助手集成
Install Unicon skills for AI coding assistants:
bash
undefined为AI编码助手安装Unicon技能:
bash
undefinedList supported assistants
列出支持的助手
unicon skill --list
unicon skill --list
Install for specific assistant
为特定助手安装
unicon skill --ide claude # Claude Code
unicon skill --ide cursor # Cursor
unicon skill --ide windsurf # Windsurf
unicon skill --ide claude # Claude Code
unicon skill --ide cursor # Cursor
unicon skill --ide windsurf # Windsurf
Install for all supported assistants
为所有支持的助手安装
unicon skill --all
undefinedunicon skill --all
undefinedSupported AI Assistants
支持的AI助手
| IDE | Directory |
|---|---|
| Claude Code | |
| Cursor | |
| Windsurf | |
| Agent | |
| Antigravity | |
| OpenCode | |
| Codex | |
| Aider | |
Once installed, ask your AI assistant: "Add a home icon to my project"
| IDE | 目录 |
|---|---|
| Claude Code | |
| Cursor | |
| Windsurf | |
| Agent | |
| Antigravity | |
| OpenCode | |
| Codex | |
| Aider | |
安装完成后,你可以向AI助手提问:"为我的项目添加一个主页图标"
Cache
缓存
Icons are cached locally at for 24 hours:
~/.unicon/cachebash
unicon cache --stats # Show cache info
unicon cache --clear # Clear cache图标会被本地缓存到,缓存有效期为24小时:
~/.unicon/cachebash
unicon cache --stats # 查看缓存信息
unicon cache --clear # 清空缓存