/ux-icons
Symfony UX Icons for rendering SVG icons in Twig templates. Supports 200,000+ Iconify icons (Lucide, Heroicons, Tabler, Material Design, etc.), local SVG files, and custom icon sets with aliases. Use when displaying icons, configuring icon defaults, importing or locking
$ npx -y skills add smnandre/symfony-ux-skills --skill ux-icons --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.
- You can call itInvoke it directly when you want it.
- Slash command
/ux-icons
Context preview
The summary Claude sees to decide when to auto-load this skill.
Symfony UX Icons for rendering SVG icons in Twig templates. Supports 200,000+ Iconify icons (Lucide, Heroicons, Tabler, Material Design, etc.), local SVG files, and custom icon sets with aliases. Use when displaying icons, configuring icon defaults, importing or locking
SKILL.md
ux-icons.SKILL.mdname: ux-icons
description: 'Symfony UX Icons for rendering SVG icons in Twig templates. Supports 200,000+ Iconify icons (Lucide, Heroicons, Tabler, Material Design, etc.), local SVG files, and custom icon sets with aliases. Use when displaying icons, configuring icon defaults, importing or locking on-demand icons, creating icon aliases, or styling SVG icons with CSS. Code triggers: <twig:ux:icon />, ux_icon(), UX_ICONS_DEFAULT_ICON_ATTRIBUTES, icon.yaml, icons/, iconify:, lucide:, heroicons:, tabler:, mdi:, bin/console ux:icons:lock, bin/console ux:icons:import. Also trigger when the user asks "how to add an icon", "how to use Lucide/Heroicons/Tabler icons", "how to render an SVG icon in Twig", "how to lock icons for production", "how to create icon aliases", "how to style an icon", "icon not found", "icon not rendering". Do NOT trigger for interactive maps (use ux-map) or general Twig components (use twig-component).'
license: MIT
metadata:
author: Simon Andre
email: smn.andre@gmail.com
url: https://smnandre.dev
version: "1.2.0"
UX Icons
Render local and remote SVG icons in Twig templates. Icons can come from local files, Iconify.design (200+ icon sets, 200,000+ icons), or custom icon sets. Icons are inlined as `<svg>` elements -- no icon fonts, no external requests at runtime.
Installation
composer require symfony/ux-icons
Quick Reference
ux_icon('name') Twig function
ux_icon('name', {class: 'w-4 h-4'}) with HTML attributes
<twig:ux:icon name="name" /> Twig component (requires ux-twig-component)
<twig:ux:icon name="set:name" /> icon from a specific setRendering Icons
Twig Function
{{ ux_icon('menu') }}
{# renders <svg ...>...</svg> #}
{{ ux_icon('user-profile', {class: 'w-4 h-4'}) }}
{# renders <svg class="w-4 h-4"> ... </svg> #}
{{ ux_icon('user-profile', {height: '16px', width: '16px', 'aria-hidden': true}) }}
{# renders <svg height="16" width="16" aria-hidden="true"> ... </svg> #}Twig Component (HTML Syntax)
Requires `symfony/ux-twig-component`.
<twig:ux:icon name="user-profile" class="w-4 h-4" />
<twig:ux:icon name="flowbite:user-solid" />
<twig:ux:icon name="user-profile" height="16" width="16" aria-hidden="true" />
Any HTML attribute added to the component or passed to the function is rendered on the `<svg>` element.
Icon Names
Local Icons
Stored in `assets/icons/` by default. The file path (minus `.svg`) becomes the icon name:
assets/icons/
├─ close.svg → ux_icon('close')
├─ menu.svg → ux_icon('menu')
└─ header/
└─ logo.svg → ux_icon('header:logo')Subdirectories become prefixes separated by `:`. Use local icons for your own project-specific SVGs (app logo, custom illustrations).
Iconify (On-Demand)
Use `prefix:name` syntax to pull icons from any Iconify set:
{# UI icons #}
{{ ux_icon('lucide:arrow-right') }} {# Lucide #}
{{ ux_icon('tabler:heart') }} {# Tabler #}
{{ ux_icon('heroicons:star-solid') }} {# Heroicons #}
{{ ux_icon('mdi:check') }} {# Material Design Icons #}
{# Country flags #}
<twig:ux:icon name="flagpack:fr" />
<twig:ux:icon name="flagpack:{{ country.code|lower }}" />
{# Brand logos #}
<twig:ux:icon name="simple-icons:symfony" />
<twig:ux:icon name="simple-icons:github" />
{# File type icons #}
<twig:ux:icon name="bi:filetype-pdf" />
<twig:ux:icon name="bi:filetype-{{ file.extension }}" />On-demand icons are fetched from the Iconify API, cached locally, and inlined as SVG. No runtime HTTP requests in production.
Browse all available sets at https://icon-sets.iconify.design/
Configuration
# config/packages/ux_icons.yaml
ux_icons:
# Local directory for icon SVG files
icon_dir: '%kernel.project_dir%/assets/icons'
# Default HTML attributes added to every icon
default_icon_attributes:
fill: currentColor
'font-size': '1.25em'
# Aliases: shortcut name => full icon name
aliases:
dots: 'clarity:ellipsis-horizontal-line'
'tabler:save': 'tabler:device-floppy'
# Iconify integration
iconify:
enabled: true
on_demand: true
endpoint: 'https://api.iconify.design'
# Silently ignore missing icons (renders nothing instead of throwing)
ignore_not_found: falseIcon Sets
Define custom icon sets with their own prefix, source, and default attributes:
ux_icons:
icon_sets:
# Local directory with custom attributes
flags:
path: '%kernel.project_dir%/assets/images/flags'
icon_attributes:
class: 'flag'
fill: false # "false" removes a default attribute
# Alias an entire Iconify set under a shorter prefix
icons:
alias: 'lucide' # ux_icon('icons:arrow-right') → lucide:arrow-rightAliases
Create shortcuts for frequently used icons:
ux_icons:
aliases:
dots: 'clarity:ellipsis-horizontal-line'
save: 'lucide:save'
delete: 'lucide:trash-2'
'tabler:save': 'tabler:device-floppy' # can also remap within a set{{ ux_icon('dots') }} {# resolves to clarity:ellipsis-horizontal-line #}
{{ ux_icon('save') }} {# resolves to lucide:save #}CLI Commands
Import Icons Locally
Download icons from Iconify into your local `assets/icons/` directory:
# Import a single icon
php bin/console ux:icons:import flowbite:user-solid
# Import multiple icons
php bin/console ux:icons:import flowbite:user-solid flowbite:home-solid
# Force overwrite existing files
php bin/console ux:icons:import flowbite:user-solid --force
Lock All On-Demand Icons
Download all icons currently used via on-demand into local files (similar to a dependency lock):
php bin/console ux:icons:lock
# Force overwrite
php bin/console ux:icons:l
Read more
name: ux-icons description: 'Symfony UX Icons for rendering SVG icons in Twig templates. Supports 200,000+ Iconify icons (Lucide, Heroicons, Tabler, Material Design, etc.), local SVG files, and custom icon sets with aliases. Use when displaying icons, configuring icon defaults, importing or locking on-demand icons, creating icon aliases, or styling SVG icons with CSS. Code triggers: <twig:ux:icon />, ux_icon(), UX_ICONS_DEFAULT_ICON_ATTRIBUTES, icon.yaml, icons/, iconify:, lucide:, heroicons:, tabler:, mdi:, bin/console ux:icons:lock, bin/console ux:icons:import. Also trigger when the user asks "how to add an icon", "how to use Lucide/Heroicons/Tabler icons", "how to render an SVG icon in Twig", "how to lock icons for production", "how to create icon aliases", "how to style an icon", "icon not found", "icon not rendering". Do NOT trigger for interactive maps (use ux-map) or general Twig components (use twig-component).' license: MIT metadata: author: Simon Andre email: smn.andre@gmail.com url: https://smnandre.dev version: "1.2.0"
UX Icons
Render local and remote SVG icons in Twig templates. Icons can come from local files, Iconify.design (200+ icon sets, 200,000+ icons), or custom icon sets. Icons are inlined as `<svg>` elements -- no icon fonts, no external requests at runtime.
Installation
composer require symfony/ux-icons
Quick Reference
ux_icon('name') Twig function
ux_icon('name', {class: 'w-4 h-4'}) with HTML attributes
<twig:ux:icon name="name" /> Twig component (requires ux-twig-component)
<twig:ux:icon name="set:name" /> icon from a specific setRendering Icons
Twig Function
{{ ux_icon('menu') }}
{# renders <svg ...>...</svg> #}
{{ ux_icon('user-profile', {class: 'w-4 h-4'}) }}
{# renders <svg class="w-4 h-4"> ... </svg> #}
{{ ux_icon('user-profile', {height: '16px', width: '16px', 'aria-hidden': true}) }}
{# renders <svg height="16" width="16" aria-hidden="true"> ... </svg> #}Twig Component (HTML Syntax)
Requires `symfony/ux-twig-component`.
<twig:ux:icon name="user-profile" class="w-4 h-4" /> <twig:ux:icon name="flowbite:user-solid" /> <twig:ux:icon name="user-profile" height="16" width="16" aria-hidden="true" />
Any HTML attribute added to the component or passed to the function is rendered on the `<svg>` element.
Icon Names
Local Icons
Stored in `assets/icons/` by default. The file path (minus `.svg`) becomes the icon name:
assets/icons/
├─ close.svg → ux_icon('close')
├─ menu.svg → ux_icon('menu')
└─ header/
└─ logo.svg → ux_icon('header:logo')Subdirectories become prefixes separated by `:`. Use local icons for your own project-specific SVGs (app logo, custom illustrations).
Iconify (On-Demand)
Use `prefix:name` syntax to pull icons from any Iconify set:
{# UI icons #}
{{ ux_icon('lucide:arrow-right') }} {# Lucide #}
{{ ux_icon('tabler:heart') }} {# Tabler #}
{{ ux_icon('heroicons:star-solid') }} {# Heroicons #}
{{ ux_icon('mdi:check') }} {# Material Design Icons #}
{# Country flags #}
<twig:ux:icon name="flagpack:fr" />
<twig:ux:icon name="flagpack:{{ country.code|lower }}" />
{# Brand logos #}
<twig:ux:icon name="simple-icons:symfony" />
<twig:ux:icon name="simple-icons:github" />
{# File type icons #}
<twig:ux:icon name="bi:filetype-pdf" />
<twig:ux:icon name="bi:filetype-{{ file.extension }}" />On-demand icons are fetched from the Iconify API, cached locally, and inlined as SVG. No runtime HTTP requests in production.
Browse all available sets at https://icon-sets.iconify.design/
Configuration
# config/packages/ux_icons.yaml
ux_icons:
# Local directory for icon SVG files
icon_dir: '%kernel.project_dir%/assets/icons'
# Default HTML attributes added to every icon
default_icon_attributes:
fill: currentColor
'font-size': '1.25em'
# Aliases: shortcut name => full icon name
aliases:
dots: 'clarity:ellipsis-horizontal-line'
'tabler:save': 'tabler:device-floppy'
# Iconify integration
iconify:
enabled: true
on_demand: true
endpoint: 'https://api.iconify.design'
# Silently ignore missing icons (renders nothing instead of throwing)
ignore_not_found: falseIcon Sets
Define custom icon sets with their own prefix, source, and default attributes:
ux_icons:
icon_sets:
# Local directory with custom attributes
flags:
path: '%kernel.project_dir%/assets/images/flags'
icon_attributes:
class: 'flag'
fill: false # "false" removes a default attribute
# Alias an entire Iconify set under a shorter prefix
icons:
alias: 'lucide' # ux_icon('icons:arrow-right') → lucide:arrow-rightAliases
Create shortcuts for frequently used icons:
ux_icons:
aliases:
dots: 'clarity:ellipsis-horizontal-line'
save: 'lucide:save'
delete: 'lucide:trash-2'
'tabler:save': 'tabler:device-floppy' # can also remap within a set{{ ux_icon('dots') }} {# resolves to clarity:ellipsis-horizontal-line #}
{{ ux_icon('save') }} {# resolves to lucide:save #}CLI Commands
Import Icons Locally
Download icons from Iconify into your local `assets/icons/` directory:
# Import a single icon php bin/console ux:icons:import flowbite:user-solid # Import multiple icons php bin/console ux:icons:import flowbite:user-solid flowbite:home-solid # Force overwrite existing files php bin/console ux:icons:import flowbite:user-solid --force
Lock All On-Demand Icons
Download all icons currently used via on-demand into local files (similar to a dependency lock):
php bin/console ux:icons:lock # Force overwrite php bin/console ux:icons:l
Showing the first part of this file.
AI agent skills for the Symfony UX frontend stack -- Stimulus, Turbo, TwigComponent, LiveComponent, UX Icons and UX Map. By Simon Andre
Repo: smnandre/symfony-ux-skills
Other skills on symfony-ux-skills.
- /live-component
Symfony UX LiveComponent for reactive server-rendered UI -- components that re-render via AJAX on user interaction, zero JavaScript required. Use when building live search, real-time filtering, dynamic forms, inline validation, dependent selects, auto-save, polling,
Open skill - /stimulus
Stimulus JS framework for Symfony UX -- client-side behavior via HTML data attributes, zero server round-trips. Use when creating controllers for DOM manipulation, handling click/input/submit events, managing targets and values, wiring outlets between controllers, wrapping
Open skill - /symfony-ux
Symfony UX frontend stack -- decision tree and orchestrator for choosing between Stimulus, Turbo, TwigComponent, LiveComponent, UX Icons, and UX Map. Use when the user is unsure which tool fits, wants to combine multiple UX packages, or asks a general frontend architecture
Open skill - /turbo
Hotwire Turbo for Symfony UX -- SPA-like speed with zero JavaScript. Covers Drive (navigation), Frames (partial page sections), and Streams (multi-target updates). Use when building ajax navigation, lazy-loaded sections, inline editing, pagination without reload, modals from the
Open skill - /twig-component
Symfony UX TwigComponent for reusable UI building blocks -- server-rendered components with PHP classes and Twig templates. Use when creating buttons, cards, alerts, badges, navbars, or any reusable UI element with props, blocks/slots, computed properties, or anonymous
Open skill - /ux-map
Symfony UX Map for interactive maps with Leaflet or Google Maps in Symfony. Covers markers, polygons, polylines, circles, info windows, and LiveComponent integration. Use when displaying maps, placing markers, drawing shapes or routes, handling map events, building store
Open skill

