How to use blade-icons
The blade-icons package allows you to easily use SVG's in your Blade views.
Besides being able to use your own SVG's, you can also add one of the many third party icon sets, such as:
From the same directory where you've installed Acorn (typically your site root or your Sage theme folder), add
blade-icons as a Composer dependency:
Then publish the configuration file:
From the published
config/blade-icons.php file, we recommend setting the default set to point to your theme directory:
Add a new directory inside
icons/ and place your SVG icons in this directory.
Using icons in Blade views
From your Blade views you can now use the provided Blade component, or the
Adding icon sets
blade-icons supports a lot of different icon sets through packages made through the community. The Blade icons search allows you to quickly find a new icon to use in your project.
To add aditional icon sets, require them as Composer dependencies the same as you did for the
blade-icons package. In this example, we'll add the
Now Heroicons can be referenced in any of the supported methods from inside your Blade views:
The blade-icons README covers how to pass attributes, set default classes, and more.
Help us continue to build and maintain our open source projects. We’re a small team of independent developers and every little bit helps.Sponsor Roots on GitHub