Back to UI/UX Design

icon-design

UI/UXiconographydesign systemfront-endvisual designLucideHeroiconsPhosphor
860📄 MIT🕒 2026-06-11Source ↗

Install this skill

npx skills add jezweb/claude-skills

Works across Claude Code, Cursor, Codex, Copilot & Antigravity

The icon-design skill streamlines UI/UX interface development by standardizing icon selection and implementation within React and TypeScript environments. It shifts manual icon searching into a structured workflow, prioritizing specific libraries like Lucide, Heroicons, and Phosphor based on project requirements. The system enforces strict architectural guardrails, specifically prohibiting the use of emojis for interface elements in favor of tree-shakeable SVG components. It provides a decision tree for conceptual mapping—matching abstract ideas like security, communication, or speed to distinct visual symbols. By mandating explicit import maps and consistent sizing scales via Tailwind CSS, this skill ensures visual uniformity across dashboards, landing pages, and application navigation while maintaining optimal bundle performance by preventing the loading of unnecessary icon sets.

When to Use This Skill

  • Standardizing navigation menus across a large React codebase
  • Replacing legacy, heavy icon fonts with modern, lightweight SVG sets
  • Building reusable component libraries that require dynamic icon rendering
  • Maintaining visual consistency in multi-developer design systems

How to Invoke This Skill

Example prompts that trigger this skill in Claude Code, Cursor, or Antigravity:

  • What icon should I use for a user settings menu?
  • Show me how to map a concept to an icon using Lucide
  • How do I prevent bundling every icon in my project?
  • What are the best practices for sizing icons in React?
  • Help me choose between Phosphor and Heroicons for my Tailwind project

Pro Tips

  • 💡Always provide the context of the icon's use (e.g., 'icon for a new message notification in a social app') for more precise suggestions.
  • 💡Specify your preferred icon library if you have one (e.g., 'suggest a Heroicons icon for settings') to narrow down results.
  • 💡Review alternative suggestions critically; sometimes a less literal icon conveys the meaning more effectively or fits the overall design better.

What this skill does

  • Maps conceptual business terms to consistent industry-standard icons
  • Provides a standardized Tailwind CSS sizing scale for responsive design
  • Forces explicit import mapping to enable efficient tree-shaking
  • Enforces strict separation between UI icons and decorative emojis
  • Normalizes color handling using current-color inheritance

When not to use it

  • Projects requiring heavy branding that use custom, non-library SVGs
  • Low-code environments that do not support standard React module imports

Example workflow

  1. Identify the UI concept that requires a visual label
  2. Consult the library comparison to select the appropriate provider
  3. Verify the chosen icon against the semantic mapping table
  4. Import the icon component using a named import statement
  5. Define an ICON_MAP object to avoid dynamic import failures
  6. Apply specific Tailwind classes based on the predefined sizing scale

Prerequisites

  • React project environment
  • Tailwind CSS configuration
  • Installed icon library package

Pitfalls & limitations

  • !Using dynamic property access on icon libraries which triggers full-bundle imports
  • !Inconsistent sizing resulting from mixed utility classes
  • !Using emojis instead of component-based icons which breaks styling capabilities

FAQ

Why is dynamic icon importing discouraged?
Dynamic importing prevents tree-shaking, forcing the browser to load the entire icon library instead of only the components you actually use.
Which library should I default to?
Lucide is the recommended default due to its extensive catalog and excellent integration with React applications.
Can I use colors like text-blue-500 on my icons?
It is best practice to use semantic colors like text-primary to ensure your icons maintain visual harmony across your application's light and dark themes.

How it compares

Unlike manual searching, this skill enforces technical constraints like tree-shaking and sizing standards that prevent common architectural debt and visual regressions.

Source & trust

860 stars📄 MIT🕒 Updated 2026-06-11
📄 Full skill instructions — original source: jezweb/claude-skills
# Icon Design

Select the right icon for the job. Maps concepts to icons, provides templates, prevents common mistakes.

## Quick Reference (Top 20 Concepts)

| Concept | Lucide | Heroicons | Phosphor |
|---------|--------|-----------|----------|
| Award/Quality | Trophy | trophy | Trophy |
| Price/Value | Tag | tag | Tag |
| Location | MapPin | map-pin | MapPin |
| Expertise | GraduationCap | academic-cap | GraduationCap |
| Support | MessageCircle | chat-bubble-left-right | ChatCircle |
| Security | Shield | shield-check | Shield |
| Speed | Zap | bolt | Lightning |
| Phone | Phone | phone | Phone |
| Email | Mail | envelope | Envelope |
| User/Profile | User | user | User |
| Team | Users | user-group | Users |
| Settings | Settings | cog-6-tooth | Gear |
| Home | Home | home | House |
| Search | Search | magnifying-glass | MagnifyingGlass |
| Check/Success | Check | check | Check |
| Close/Cancel | X | x-mark | X |
| Menu | Menu | bars-3 | List |
| Calendar | Calendar | calendar | Calendar |
| Clock/Time | Clock | clock | Clock |
| Heart/Favourite | Heart | heart | Heart |

## Library Selection

| Library | Best For | Package |
|---------|----------|---------|
| **Lucide** | General use, React projects | lucide-react |
| **Heroicons** | Tailwind projects, minimal style | @heroicons/react |
| **Phosphor** | Weight variations needed | @phosphor-icons/react |

**Default recommendation**: Lucide (1,400+ icons, excellent React integration)

See references/library-comparison.md for detailed comparison.

## Icon Style Rules

### Sizing

| Context | Tailwind Class | Pixels |
|---------|----------------|--------|
| Inline with text | w-4 h-4 or w-5 h-5 | 16-20px |
| Feature cards | w-8 h-8 | 32px |
| Hero sections | w-10 h-10 or w-12 h-12 | 40-48px |
| Large decorative | w-16 h-16 | 64px |

### Consistency Rules

1. **Never mix styles** - Use all outline OR all solid in a section
2. **Never use emoji** - Use proper icon components (tree-shakeable)
3. **Use currentColor** - Icons inherit text color via stroke="currentColor"
4. **Semantic colours** - Use text-primary, not text-blue-500

### Tree-Shaking (Critical)

Dynamic icon selection breaks tree-shaking. Use explicit maps:

// 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]


## Selection Process

1. **Identify the concept** - What does the label/title communicate?
2. **Check semantic mapping** - See references/semantic-mapping.md
3. **Choose library** - Lucide (default), Heroicons (Tailwind), Phosphor (weights)
4. **Apply template** - See references/icon-templates.md
5. **Verify consistency** - Same style, same size in section

## Decision Tree

When unsure which icon:

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)


## Resources

- references/semantic-mapping.md - Full concept→icon tables by category
- references/icon-templates.md - React/HTML patterns with Tailwind
- references/library-comparison.md - Lucide vs Heroicons vs Phosphor
- references/migration-guide.md - FA/Material → modern equivalents
- rules/icon-design.md - Correction rules for projects


---

# Icon Design Rules

Correction rules for icon usage in React/TypeScript projects.

## Never Use Emoji for UI Icons

Emoji render inconsistently across platforms and can't be styled.

| If Claude suggests... | Use instead... |
|----------------------|----------------|
| <span>✅</span> | <Check className="w-4 h-4" /> |
| <span>⚠️</span> | <AlertTriangle className="w-4 h-4" /> |
| ✉️ Email | <Mail className="w-4 h-4" /> Email |
| 📍 Location | <MapPin className="w-4 h-4" /> Location |

## Tree-Shaking Prevention

Dynamic icon access breaks tree-shaking, bundling ALL icons.

| If Claude suggests... | Use instead... |
|----------------------|----------------|
| import * as Icons from 'lucide-react' | Named imports only |
| Icons[iconName] | Explicit ICON_MAP object |
| require('lucide-react')[name] | Static imports |

Correct pattern:

import { Home, User, Settings, type LucideIcon } from 'lucide-react'

const ICON_MAP: Record<string, LucideIcon> = {
home: Home,
user: User,
settings: Settings,
}

const Icon = ICON_MAP[iconName]
if (!Icon) throw new Error(Unknown icon: ${iconName})


## Use Semantic Colours

Icons should use Tailwind v4 semantic tokens, not raw colours.

| If Claude suggests... | Use instead... |
|----------------------|----------------|
| className="text-blue-500" | className="text-primary" |
| className="text-gray-500" | className="text-muted-foreground" |
| className="text-red-500" | className="text-destructive" |
| stroke="#3B82F6" | className="text-primary" (uses currentColor) |

## Consistent Sizing

Use standard size classes within a section.

| Context | Class | Notes |
|---------|-------|-------|
| Inline text | w-4 h-4 or w-5 h-5 | Match line height |
| Feature cards | w-6 h-6 to w-8 h-8 | Inside container |
| Hero sections | w-10 h-10 to w-12 h-12 | Decorative |

| If Claude suggests... | Use instead... |
|----------------------|----------------|
| Mixed sizes in one section | Same size for all icons in section |
| size={24} (Phosphor) | className="w-6 h-6" (Tailwind) |
| width="20" height="20" | className="w-5 h-5" |

## Style Consistency

Never mix outline and solid icons in the same section.

| If Claude suggests... | Use instead... |
|----------------------|----------------|
| CheckIcon (solid) next to HomeIcon (outline) | All outline OR all solid |
| Heroicons /24/outline mixed with /24/solid | Pick one style for section |
| Phosphor weight="fill" mixed with weight="regular" | Single weight per section |

## Heroicons Import Paths

Heroicons have specific import paths for sizes and styles.

| If Claude suggests... | Use instead... |
|----------------------|----------------|
| @heroicons/react/outline | @heroicons/react/24/outline |
| @heroicons/react/solid | @heroicons/react/24/solid |
| import { Home } | import { HomeIcon } (suffix required) |

Correct patterns:

// 24px outline (default)
import { HomeIcon } from '@heroicons/react/24/outline'

// 24px solid
import { HomeIcon } from '@heroicons/react/24/solid'

// 20px solid (mini)
import { HomeIcon } from '@heroicons/react/20/solid'


## Accessibility

Decorative icons need proper handling.

| If Claude suggests... | Use instead... |
|----------------------|----------------|
| <Icon /> (no label) | <Icon aria-hidden="true" /> or with aria-label |
| Icon-only button without label | Add aria-label="Description" to button |

Correct patterns:

// Decorative icon (alongside text)
<span className="flex items-center gap-2">
<Phone aria-hidden="true" className="w-4 h-4" />
<span>Call us</span>
</span>

// Icon-only button
<button aria-label="Open menu">
<Menu className="w-6 h-6" />
</button>

// Meaningful standalone icon
<CheckCircle aria-label="Completed" className="w-5 h-5 text-green-500" />


## Lucide Wrapper Elements

Lucide icons don't accept HTML attributes like title directly.

| If Claude suggests... | Use instead... |
|----------------------|----------------|
| <Trophy title="Award" /> | <span title="Award"><Trophy /></span> |
| <Icon aria-label="..." /> | Wrap in element with aria-label |

## currentColor Pattern

Icons should inherit colour from parent text.

| If Claude suggests... | Use instead... |
|----------------------|----------------|
| stroke="#000000" | Use default (currentColor) |
| fill="blue" | className="text-primary" |
| Hardcoded colours in SVG | Let CSS control via currentColor |

How to Use This Skill Unit

Option A: Project-Specific (Recommended)

  1. Click "Download" above
  2. In your project, create the directory: .agent/skills/icon-design/
  3. Save the file as SKILL.md
  4. The agent will automatically discover the skill based on its description.

Option B: Global Installation (All Agents)

Save the file to these locations to make it available across all projects:

  • Claude Code: ~/.claude/skills/jezweb/claude-skills/icon-design/SKILL.md
  • Cursor: ~/.cursor/skills/jezweb/claude-skills/icon-design/SKILL.md
  • Antigravity: ~/.gemini/antigravity/skills/jezweb/claude-skills/icon-design/SKILL.md

🚀 Install with CLI:
npx skills add jezweb/claude-skills

Read the Master Guide: Mastering Agent Skills

Recommended Rules

View more rules

Recommended Workflows

View more workflows

Recommended MCP Servers

View more MCP servers

Take It Further

Maximize your productivity with these powerful resources

📋

Define Your Standards

Set up coding standards to ensure this workflow produces consistent, high-quality results.

Browse Rules Library
📖

Master Workflows

Learn how to create custom workflows, use Turbo Mode, and build your automation library.

Complete Guide

How to use this Skill in Claude Code & Cursor

For Claude Code (CLI)

To use this skill in Claude Code, copy the rule content into your project's custom instructions or follow our Add-Skill CLI guide. This ensures Claude follows your standards during every code generation.

For Cursor & Windsurf

For Cursor or Windsurf, individual skills are best used in the "Rules for AI" section. This specific unit helps the agent avoid ui/ux design issues, leading to cleaner, more efficient code.

Why the skill format matters: the standardized Agent Skills format lets your AI agent load detailed instructions only when they are relevant, keeping your prompt clean while improving results.

Source & attribution

This skill is categorized under UI/UX Design and is published by JezWeb, maintained in jezweb/claude-skills.

← Browse All Agent Skills
Sponsored AI assistant. Recommendations may be paid.