- How do I install Blade Icons in a Laravel application?
- Install it with composer require blade-ui-kit/blade-icons, then publish the config with php artisan vendor:publish --tag=blade-icons. The default icon set in config/blade-icons.php ships commented out, so uncomment it and point its path at resources/svg. Drop your SVG files there and render them with <x-icon-camera /> or @svg('camera'). Run php artisan icons:cache once your icons are in place if you cache in production.
- Why are my Blade Icons not showing up in production?
- The usual cause is the cached icon manifest: production reads a cached map of icons, so an SVG added without re-running php artisan icons:cache renders nothing instead of failing the build. Also confirm the default icon set is actually uncommented in config/blade-icons.php, because a fresh install silently renders nothing until you do that. Verify the configured path and prefix resolve to the file you expect, and run php artisan config:clear after any config change.
- Which Laravel and PHP versions does Blade Icons support?
- Blade Icons requires PHP 7.4 or newer and Laravel 8 or newer, which sits well below every currently supported Laravel and PHP release, so version conflicts are unlikely. It has no database, queue, middleware, or auth requirements, so it fits any application structure. As with any dependency, pin the version in composer.json and review upgrades deliberately.
- Should I use the x-icon component or the @svg directive?
- The component renders an icon with an attribute bag, so classes like class="w-6 h-6" and other HTML attributes pass straight through to the SVG, which suits static markup and Tailwind utilities. The @svg directive takes the icon name and class as arguments, which is handier for dynamic names inside loops or string-built markup. Both produce the same inlined SVG output, so the choice is mostly ergonomic.
- How do I register a custom icon set in Blade Icons?
- Add an entry to the sets array in config/blade-icons.php with a path pointing at the directory of SVG files and a prefix used in the component and directive names. Blade Icons resolves icons per set prefix and config precedence, so give each set a distinct prefix to avoid silent name collisions. Re-run php artisan icons:cache afterwards if you cache icons in production.
- How do I cache icons and when must I re-run icons:cache?
- Run php artisan icons:cache to build a cached manifest of your icons, and php artisan icons:clear to remove it. You must re-run icons:cache whenever you add, rename, or remove an SVG in an environment that uses the cache, otherwise the icon will not resolve at runtime. Putting that command in your deploy pipeline is the safest way to keep new icons from depending on someone remembering.
- Does Blade Icons work with Inertia, Vue, or React frontends?
- No. Blade Icons only works inside Blade templates, so it contributes nothing to Inertia, Vue, React, or any other JS-rendered surface. If part of your application is an SPA you will end up running two icon pipelines, which is a decision worth making before you adopt the package.
- How do I use Heroicons, Lucide, or Font Awesome icons with Blade Icons?
- The Blade Icons README lists roughly a hundred community icon set packages covering Heroicons, Lucide, Tabler, Font Awesome, Bootstrap Icons, and more. Each one is a separate Composer dependency with its own maintainer and release cadence, so audit it and pin the version. If you would rather control sourcing and licensing, you can vendor curated SVG files in your repo and register them as a local icon set instead.
- Do Blade Icons work with dark mode and currentColor, and what about accessibility?
- Icons are inlined as full SVG markup, so any icon with hardcoded fill or stroke colors ignores currentColor and breaks dark mode and theming; prefer icons that use currentColor throughout. Accessibility is unopinionated, so you need to add aria-hidden="true" for decorative icons and role="img" plus a title for meaningful ones, ideally through a wrapper component. Inline SVG can also interact with strict CSP style-src and img-src policies, so check it against your security baseline before broad adoption.
- Is Blade Icons actively maintained, and what happens if it is abandoned?
- The core package is MIT licensed and actively released, but it is effectively single-maintainer, so abandonment risk is low yet non-zero; the codebase is small and forkable if that ever happens. The larger variable is the third-party icon set packages, which are community repositories of widely varying maintenance quality. Audit and pin whichever sets you adopt, and treat the icon manifest cache as part of your deployment runbook.