artisanpack-ui/icons
Register and use your own SVG icon sets in Laravel with minimal overhead. Integrates with blade-ui-kit/blade-icons and Livewire UI, supports config or event-based registration, and makes it easy to add premium sets like Font Awesome Pro.
This guide will walk you through installing and setting up the ArtisanPack UI Icons package in your Laravel application. This package serves as an extensibility layer for custom icon sets using blade-ui-kit/blade-icons.
blade-ui-kit/blade-icons ^1.8Install the package via Composer:
composer require artisanpack-ui/icons
The package uses Laravel's auto-discovery feature, so the service provider will be automatically registered.
Publish the configuration file to customize your icon sets:
php artisan vendor:publish --tag=artisanpack-package-config
This creates config/artisanpack/icons.php where you can register your icon sets.
Edit config/artisanpack/icons.php to register your icon sets:
<?php
return [
/*
|--------------------------------------------------------------------------
| Custom Icon Sets
|--------------------------------------------------------------------------
|
| Register your custom SVG icon sets here. Each set requires a path to
| the directory containing SVG files and a unique prefix for the icons.
|
*/
'sets' => [
[
'path' => resource_path('icons/fontawesome-pro'),
'prefix' => 'fa',
],
[
'path' => resource_path('icons/heroicons'),
'prefix' => 'hero',
],
[
'path' => resource_path('icons/custom'),
'prefix' => 'custom',
],
],
];
Create the directories and place your SVG icon files:
resources/
├── icons/
│ ├── fontawesome-pro/
│ │ ├── home.svg
│ │ ├── user.svg
│ │ └── settings.svg
│ ├── heroicons/
│ │ ├── bell.svg
│ │ ├── calendar.svg
│ │ └── chart.svg
│ └── custom/
│ ├── logo.svg
│ └── brand.svg
Important: Ensure your SVG files are clean and optimized. Remove any width, height, or fill attributes to allow for proper styling via CSS classes.
Once configured, you can use your icons as Blade components:
{{-- Font Awesome Pro icons --}}
<x-icon-fa-home class="w-6 h-6 text-gray-600" />
<x-icon-fa-user class="w-5 h-5 text-blue-500" />
{{-- Heroicons --}}
<x-icon-hero-bell class="w-4 h-4" />
<x-icon-hero-calendar class="w-6 h-6 text-green-500" />
{{-- Custom icons --}}
<x-icon-custom-logo class="w-8 h-8" />
<x-icon-custom-brand class="w-12 h-12 text-purple-600" />
To verify your installation is working correctly:
Check the configuration is published:
ls -la config/artisanpack/icons.php
Test an icon in a Blade view:
<x-icon-fa-home class="w-6 h-6" />
Check for errors in Laravel logs:
tail -f storage/logs/laravel.log
For Font Awesome Pro users, extract your purchased icons to a directory:
# Extract Font Awesome Pro SVGs
unzip fontawesome-pro-6.x.x-web.zip
cp -r fontawesome-pro-6.x.x-web/svgs/* resources/icons/fontawesome-pro/
Update your config:
'sets' => [
[
'path' => resource_path('icons/fontawesome-pro/solid'),
'prefix' => 'fas',
],
[
'path' => resource_path('icons/fontawesome-pro/regular'),
'prefix' => 'far',
],
[
'path' => resource_path('icons/fontawesome-pro/brands'),
'prefix' => 'fab',
],
],
You can register multiple icon libraries simultaneously:
'sets' => [
['path' => resource_path('icons/heroicons'), 'prefix' => 'hero'],
['path' => resource_path('icons/tabler'), 'prefix' => 'tabler'],
['path' => resource_path('icons/feather'), 'prefix' => 'feather'],
['path' => resource_path('icons/phosphor'), 'prefix' => 'phosphor'],
],
path in your config points to existing directorieswidth, height, or hardcoded fill attributesuser-profile.svg)php artisan config:clear after configuration changesEnsure Laravel can read your icon directories:
chmod -R 755 resources/icons/
If you get "Component not found" errors:
php artisan view:clearNow that you have the package installed and configured:
How can I help you explore Laravel packages today?