Phoenix components for Iconify icons with compile-time discovery.
Summary
Functions
Gets icon data by name.
Renders an icon as an inline SVG.
Checks if an icon exists in the manifest.
Lists all available icon names from the manifest.
Normalizes icon names to the canonical Iconify format.
Functions
Gets icon data by name.
Renders an icon as an inline SVG.
Examples
<.icon name="lucide:settings" class="size-5" />
<.icon name="hero-user" class="size-6 text-zinc-500" />
<.icon name="mdi:account" label="Account" />
<.icon name="lucide:x" phx-click="close" />Attributes
name(:string) (required) - Icon name (for example, lucide:settings).class(:string) - CSS classes. Defaults tonil.label(:string) - Accessible label. Makes the SVG role=img. Defaults tonil.title(:string) - Optional SVG title text. Defaults tonil.size(:any) - Width and height to apply together. Defaults tonil.width(:any) - SVG width attribute. Defaults tonil.height(:any) - SVG height attribute. Defaults tonil.color(:string) - CSS color for currentColor icons. Defaults tonil.inline(:boolean) - Align icon with text baseline. Defaults tofalse.mode(:string) - Render mode: svg, mask, or bg. Defaults to"svg".rotate(:integer) - Additional 90-degree rotations. Defaults to0.flip(:string) - Flip direction: horizontal, vertical, or both. Defaults tonil.h_flip(:boolean) - Apply horizontal flip. Defaults tofalse.v_flip(:boolean) - Apply vertical flip. Defaults tofalse.- Global attributes are accepted. Additional SVG attributes.
Checks if an icon exists in the manifest.
Lists all available icon names from the manifest.
Normalizes icon names to the canonical Iconify format.