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.
An extensibility layer for custom icon sets that integrates seamlessly with blade-ui-kit/blade-icons and livewire-ui-components. This package provides a simple, flexible way to register and use custom SVG icon sets in your Laravel applications without the overhead of hardcoded icon libraries.
blade-ui-kit/blade-icons foundationInstall the package via Composer:
composer require artisanpack-ui/icons
Publish the configuration file:
php artisan vendor:publish --tag=artisanpack-package-config
Edit config/artisanpack/icons.php to register your icon sets:
return [
'sets' => [
'fa' => [
+ 'path' => resource_path('icons/fontawesome-pro'),
+ 'prefix' => 'fa',
+ ],
+ 'brand' => [
+ 'path' => resource_path('icons/custom-brand'),
+ 'prefix' => 'brand',
+ ],
],
];
Place your SVG files in the configured directories:
resources/
├── icons/
│ ├── fontawesome-pro/
│ │ ├── home.svg
│ │ └── user.svg
│ └── custom-brand/
│ ├── logo.svg
│ └── badge.svg
{{-- Using Font Awesome Pro icons with 'fa' prefix --}}
<x-icon-fa-home class="w-6 h-6" />
<x-icon-fa-user class="w-5 h-5 text-blue-500" />
{{-- Using custom brand icons with 'brand' prefix --}}
<x-icon-brand-logo class="w-8 h-8" />
<x-icon-brand-badge class="w-4 h-4" />
The simplest approach - define icon sets in your config/artisanpack/icons.php:
return [
'sets' => [
'hero' => [
'path' => resource_path('icons/heroicons'),
'prefix' => 'hero'
],
+ 'tabler' => [
'path' => resource_path('icons/tabler'),
'prefix' => 'tabler'
],
],
];
Perfect for packages that want to register their own icon sets:
use ArtisanPackUI\Icons\Registries\IconSetRegistration;
// In a service provider or event listener
addFilter('ap.icons.registerIconSets', function (IconSetRegistration $registry) {
$registry->addSet(__DIR__ . '/../../resources/icons', 'mypackage');
return $registry;
});
Note: In v2.2.0 the hook was renamed from
ap.icons.register-icon-setstoap.icons.registerIconSetsto align with the cross-package hooks naming convention. The old name is registered as a temporary deprecation alias — existing subscribers continue firing but emit an info-level deprecation log. The alias will be removed in the next major release.
For comprehensive documentation, visit the docs directory:
blade-ui-kit/blade-icons ^1.8As an open source project, this package is open to contributions from anyone. Please read through the contributing guidelines to learn more about how you can contribute to this project.
How can I help you explore Laravel packages today?