add-icon

Add a new Tabler icon to the project. Use when adding icons to the UI.

⭐22stars🔀2forks📁View on GitHub🕐Updated Dec 24, 2025

When & Why to Use This Skill

This Claude skill streamlines the technical workflow for integrating Tabler icons into a project's UI. It automates the multi-step process of updating configuration files, modifying Rust enum variants, and ensuring the Vite build pipeline correctly generates icon sprites, significantly reducing manual effort and potential errors in asset management.

Use Cases

  • UI Component Enhancement: Quickly add new visual indicators to user interface components by integrating specific Tabler icons with minimal manual configuration.
  • Cross-Stack Synchronization: Ensure consistency between frontend icon assets (JSON) and backend logic (Rust enums) through a guided, step-by-step update process.
  • Asset Pipeline Automation: Simplify the development workflow by leveraging automated Vite build hooks for icon sprite generation, avoiding manual SVG manipulation.
  • Project Onboarding: Provide a standardized method for new developers to add icons to the project without needing to memorize the specific file architecture and build steps.
nameadd-icon
descriptionAdd a new Tabler icon to the project. Use when adding icons to the UI.

Add Icon Skill

This skill guides you through adding a new icon from Tabler Icons to the project.

Process

Icons are managed via icons.json and automatically built by Vite plugin.

Steps

  1. Choose Icon

  2. Add to icons.json

    • Edit renderer/icons.json
    • Add the icon name to the JSON array (in alphabetical order)
  3. Build Icon Sprite (Automatic)

    • Icon sprite is automatically generated when Vite builds
    • Just run just dev or cargo build
  4. Add Rust Enum Variant

    • Edit desktop/src/components/icon.rs
    • Add variant to IconName enum (use PascalCase)
    • Add case to Display implementation

Example

renderer/icons.json:

[
  "folder",
  "folder-open",
  "file"
]

desktop/src/components/icon.rs:

pub enum IconName {
    Folder,
    FolderOpen,
    File,
}

impl std::fmt::Display for IconName {
    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
        match self {
            IconName::Folder => write!(f, "folder"),
            IconName::FolderOpen => write!(f, "folder-open"),
            IconName::File => write!(f, "file"),
        }
    }
}

File Locations

File Purpose Git Tracked
renderer/icons.json Icon list configuration ✅ Yes
renderer/vite.config.ts Icon sprite plugin ✅ Yes
renderer/public/icons/tabler-sprite.svg Generated sprite (Vite source) ❌ No
assets/dist/icons/tabler-sprite.svg Build output (Dioxus asset) ❌ No

Important

  • NEVER edit generated SVG files directly
  • The assets/dist/ directory is .gitignored as build output
  • Icon sprite generation is automatic via Vite plugin (buildStart hook)
  • Rust code references icons via asset!("/assets/dist/icons/tabler-sprite.svg")
  • Icons come from @tabler/icons npm package (outline style only)

Build Process

icons.json
    ↓
Vite plugin (buildStart hook)
    ↓
renderer/public/icons/tabler-sprite.svg
    ↓
Vite build
    ↓
assets/dist/icons/tabler-sprite.svg
    ↓
Rust asset!() macro