mcpField
I
icon-design

icon-design

github.com/jezweb设计与 UI1.1k428 次安装3 周前更新
代码仓库

关于 icon-design

帮助设计师和开发者将概念对应到图标,并保持样式一致的图标设计技能,提供图标库对比、选择指引和实现模板。

主要功能

  1. 01概念与图标对照表
  2. 02Lucide、Heroicons 和 Phosphor 指南
  3. 03尺寸与一致性规则
  4. 04Tree-shaking 建议
  5. 05React 和 HTML 模板

适用场景

  1. 01为界面概念选择图标
  2. 02保持区域内图标风格一致
  3. 03避免图标包体积过大
  4. 04从 FA 或 Material 图标迁移

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/jezweb/claude-skills --skill icon-design

安装后在 Claude Code 中输入/icon-design确认已加载。

包含的文件

除 SKILL.md 外,安装时一起下载的参考资料和脚本。

README.md
.claude-plugin/
plugin.json
agents/
icon-selector.md
references/
icon-templates.md
library-comparison.md
migration-guide.md
semantic-mapping.md
rules/
icon-design.md

详细介绍

图标设计

为任务选择合适的图标。将概念映射到图标,提供模板,避免常见错误。

快速参考(20 个常用概念)

概念LucideHeroiconsPhosphor
奖项/品质TrophytrophyTrophy
价格/价值TagtagTag
位置MapPinmap-pinMapPin
专业知识GraduationCapacademic-capGraduationCap
支持MessageCirclechat-bubble-left-rightChatCircle
安全Shieldshield-checkShield
速度ZapboltLightning
电话PhonephonePhone
电子邮件MailenvelopeEnvelope
用户/个人资料UseruserUser
团队Usersuser-groupUsers
设置Settingscog-6-toothGear
主页HomehomeHouse
搜索Searchmagnifying-glassMagnifyingGlass
勾选/成功CheckcheckCheck
关闭/取消Xx-markX
菜单Menubars-3List
日历CalendarcalendarCalendar
时钟/时间ClockclockClock
喜爱/收藏HeartheartHeart

库的选择

库最适合包
Lucide通用场景、React 项目lucide-react
HeroiconsTailwind 项目、简约风格@heroicons/react
Phosphor需要不同粗细@phosphor-icons/react

默认推荐:Lucide(拥有 1,400 多个图标,React 集成出色)

详细对比请参阅 references/library-comparison.md。

图标样式规则

尺寸
场景Tailwind 类像素
与文本同行w-4 h-4 或 w-5 h-516-20px
功能卡片w-8 h-832px
Hero 区块w-10 h-10 或 w-12 h-1240-48px
大型装饰图标w-16 h-1664px
一致性规则
  1. 切勿混用样式——在同一区块中统一使用描边或实心样式
  2. 切勿使用表情符号——使用合适的图标组件(支持 Tree-shaking)
  3. 使用 currentColor——图标通过 stroke="currentColor" 继承文本颜色
  4. 使用语义颜色——使用 text-primary,而不是 text-blue-500
Tree-shaking(关键)

动态选择图标会破坏 Tree-shaking。请使用显式映射:

// BAD - all icons bundled
import * as Icons from 'lucide-react'
const Icon = Icons[iconName]  // Tree-shaken away!

// GOOD - explicit map
import { Home, Users, Settings, type LucideIcon } from 'lucide-react'
const ICON_MAP: Record<string, LucideIcon> = { Home, Users, Settings }
const Icon = ICON_MAP[iconName]

选择流程

  1. 确定概念——标签/标题传达的是什么?
  2. 检查语义映射——请参阅 references/semantic-mapping.md
  3. 选择库——Lucide(默认)、Heroicons(Tailwind)、Phosphor(不同粗细)
  4. 应用模板——请参阅 references/icon-templates.md
  5. 检查一致性——同一区块使用相同的样式和尺寸

决策树

不确定该选哪个图标时:

Is it about recognition/awards? → Trophy, Star, Award
Is it about money/price? → Tag, DollarSign, CreditCard
Is it about location? → MapPin, Globe, Map
Is it about people/team? → Users, UserGroup, User
Is it about communication? → MessageCircle, Phone, Mail
Is it about safety/trust? → Shield, Lock, ShieldCheck
Is it about speed/time? → Zap, Clock, Timer
Is it trade-specific? → Check semantic-mapping.md
Still unsure? → CheckCircle (generic positive) or Sparkles (generic feature)

资源

  • references/semantic-mapping.md - 按类别整理的完整概念→图标映射表
  • references/icon-templates.md - 使用 Tailwind 的 React/HTML 模式
  • references/library-comparison.md - Lucide、Heroicons 与 Phosphor 的对比
  • references/migration-guide.md - 将 FA/Material 替换为现代替代方案
  • rules/icon-design.md - 项目的修正规则

评论

支持 Markdown