Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Blade Icons

Blade Icons Laravel Package

driesvints/blade-icons

Blade Icons makes it easy to use any SVG icon set in your Laravel Blade views via components and directives like or @svg('camera'). Originally Blade SVG by Adam Wathan, it's the base for many third-party icon packages and supports custom icon sets.

View on GitHub
Deep Wiki
Context7

Blade Icons is a Laravel package that lets you use SVG icons directly in your Blade views, turning verbose inline SVG markup into clean, reusable components. Originally created as "Blade SVG" by Adam Wathan, it renders any icon from your configured icon sets with a single tag like <x-icon-camera /> or the @svg('camera') directive.

  • Simple usage — reference icons via Blade components or the @svg directive, with classes passed straight through
  • Multiple icon sets — register and organize icons from various directories or third-party packages
  • Attribute inheritance — merge classes and attributes onto rendered SVGs effortlessly
  • Caching — improve performance by caching icon lookups
  • Extensible — build your own icon set packages on top of the base package
Frequently asked questions about Blade Icons
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.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
robertmarney/lara-hierarchial-collections
simonschaufi/rule-doc-generator
emissaoja/emissaoja
blackbricksoftware/gravityforms-civicrm-form-processor
al-rahabi/fancy-crud
jinas/dhivatar-component
mltstephane/laravel-quality
bernskiold/laravel-talentlms
bernskioldmedia/laravel-form-architect
youbar/easy-crud
c-point-labs/laravel-hostyourai
dbravoan/dbcms-admin-theme-dbcms
dbravoan/dbcms-theme-db-cyber
dbravoan/dbcms-blocks-basic
dbravoan/dbcms-module-content-audit
dbravoan/dbcms-module-ai-assistant
paygate-to/paygate-php
padosoft/askmydocs-connector-base
defstudio/supercharged-carbon
bernskioldmedia/laravel-matomo