Skip to content

UX Icons JS Bundle

Render Symfony UX Icons in JavaScript, React and Vue. Same attributes, same configuration, same HTML as ux_icon(), without innerHTML.
Terminal window
composer require silarhi/ux-icons-js-bundle # dumps the icons
pnpm add @silarhi/ux-icons-js # renders them
import { UXIcon } from '@silarhi/ux-icons-js/react'
import { LucideTrash2Icon } from '../var/icons/index.js'
const icon = <UXIcon icon={LucideTrash2Icon} className="text-danger" aria-label="Delete" />

Same output as ux_icon()

default_icon_attributes, icon set icon_attributes, suffixes and aliases are resolved from your ux_icons configuration. Dumping icons

Tree-shaken

One named export per icon: your bundler drops the icons you never import. Export names

Vanilla, React and Vue

renderIcon(), createIconElement(), and a UXIcon component for React and Vue, without innerHTML. JavaScript

Works with ux:icons:lock

Write the import first, run ux:icons:lock: the icon is downloaded and dumped. Remote icons

This bundle backports symfony/ux#4072 on top of an unmodified symfony/ux-icons, from PHP 8.2 and Symfony 6.4. What differs