askill
script-kit-icons

script-kit-iconsSafety 100Repository

Unified icon system for Script Kit GPUI. Use when working with icons in the UI - rendering Lucide icons, embedded SVGs, SF Symbols (macOS), app bundle icons, or custom file/URL icons. Covers IconRef parsing, IconStyle configuration, color tokens, and the IconView rendering API.

19 stars
1.2k downloads
Updated 2/7/2026

Package Files

Loading files...
SKILL.md

Script Kit Icons

Unified icon API that abstracts multiple icon sources into a single IconRef type.

Quick Reference

use crate::icons::{IconRef, IconView, IconSize, IconColor, ColorToken, EmbeddedIcon};

// From gpui_component IconName (Lucide)
let icon = IconRef::from(gpui_component::IconName::Check);

// From string (scripts use this format)
let icon = IconRef::parse("lucide:trash").unwrap();

// Render with styling
IconView::new(icon)
    .size(IconSize::Large)
    .color(IconColor::Token(ColorToken::Accent))
    .render(theme, window)

Icon Sources

SchemeExampleNotes
lucide:lucide:trashLucide icons via gpui_component
sf:sf:gearSF Symbols (macOS 11+)
embedded:embedded:terminalScript Kit's bundled SVGs
asset:asset:icons/custom.svgSVG from assets folder
file:file:icons/my.svgScript-relative file path
url:url:https://...Remote URL (gated)
app:app:com.apple.findermacOS app bundle icon

IconRef Enum

pub enum IconRef {
    Lucide(gpui_component::IconName),  // Tintable
    SFSymbol(SharedString),             // Tintable
    Embedded(EmbeddedIcon),             // Tintable
    AssetSvg(SharedString),             // Tintable
    File(PathBuf),                      // Tintable
    Url(SharedString),                  // NOT tintable
    AppBundle(SharedString),            // NOT tintable
}

IconSize

VariantPixels
XSmall12px
Small14px
Medium16px (default)
Large20px
XLarge24px
Custom(f32)any

IconColor

pub enum IconColor {
    Inherit,              // From parent text style (default)
    Token(ColorToken),    // Theme color
    Fixed(Hsla),          // Exact color
    None,                 // No tint (full-color icons)
}

pub enum ColorToken {
    Primary,   // theme.foreground()
    Muted,     // theme.muted()
    Accent,    // theme.accent()
    Danger,    // theme.danger()
    Success,   // theme.success()
    Warning,   // theme.warning()
}

// Helpers
IconColor::from_hex(0xFF0000)  // Red

EmbeddedIcon

Script Kit's bundled SVGs:

pub enum EmbeddedIcon {
    // Files
    File, FileCode, Folder, FolderOpen,
    // Actions
    Plus, Trash, Copy, Settings, MagnifyingGlass, Terminal, Code,
    // Status
    Check, Star, StarFilled, BoltFilled, BoltOutlined,
    // Arrows
    ArrowRight, ArrowDown, ArrowUp, ChevronRight, ChevronDown,
    // UI
    Close, Sidebar,
    // Media
    PlayFilled, PlayOutlined,
}

// Parse with aliases
EmbeddedIcon::parse("terminal")     // Terminal
EmbeddedIcon::parse("search")       // MagnifyingGlass
EmbeddedIcon::parse("lightning")    // BoltFilled

IconView (Fluent Builder)

IconView::new(gpui_component::IconName::Check)
    .size(IconSize::Large)
    .color(IconColor::Token(ColorToken::Success))
    .opacity(0.8)
    .render(theme, window)  // -> AnyElement

Rendering Function

pub fn render_icon(
    icon: &IconRef,
    style: &IconStyle,
    theme: &dyn ThemeColorProvider,
    window: &Window,
) -> AnyElement

ThemeColorProvider Trait

Implement to provide theme colors:

pub trait ThemeColorProvider {
    fn foreground(&self) -> Hsla;
    fn muted(&self) -> Hsla;
    fn accent(&self) -> Hsla;
    fn danger(&self) -> Hsla;
    fn success(&self) -> Hsla;
    fn warning(&self) -> Hsla;
}

Fallback Chain

Icons that require async loading or platform APIs fall back automatically:

SourceFallback
SFSymbolMapped Lucide equivalent
AppBundleLucide::Frame
UrlLucide::ExternalLink
FileLucide::File

Lucide Name Mapping

Supports kebab-case names and common aliases:

lucide_from_str("arrow-right")  // ArrowRight
lucide_from_str("trash")        // Delete
lucide_from_str("x")            // Close
lucide_from_str("cog")          // Settings
lucide_from_str("terminal")     // SquareTerminal

File Locations

  • src/icons/mod.rs - Module root, exports
  • src/icons/types/icon_ref.rs - IconRef enum + parsing
  • src/icons/types/icon_style.rs - IconSize, IconColor, IconStyle
  • src/icons/types/embedded.rs - EmbeddedIcon enum
  • src/icons/types/lucide_mapping.rs - String-to-Lucide mapping
  • src/icons/render.rs - IconView + render_icon()

Install

Download ZIP
Requires askill CLI v1.0+

AI Quality Score

92/100Analyzed 2/12/2026

Excellent, high-density technical reference for the internal icon system. Provides clear examples, API definitions, and usage patterns.

100
95
10
95
95

Metadata

Licenseunknown
Version-
Updated2/7/2026
Publisherjohnlindquist

Tags

api