A Font Awesome icon set implementation for Filament Icons, providing a comprehensive set of Font Awesome icons that seamlessly integrate with Filament's interface.
This package extends the base Filament Icons package to replace Filament's default Heroicons with Font Awesome icons.
You can install the package via composer:
composer require filafly/filament-font-awesome-icons
Note: This package automatically installs the required
filafly/filament-icons
base package.
After the package is installed, you must register the plugin in your Filament Panel provider:
use Filafly\Icons\FontAwesomeIcons; public function panel(Panel $panel): Panel{ return $panel ->plugins([ FontAwesomeIcons::make(), ]);}
Font Awesome icons come in multiple styles that you can switch between. Available styles include:
You can change the style using the following methods:
FontAwesomeIcons::make()->classicSolid(); // (default)FontAwesomeIcons::make()->classicRegular();FontAwesomeIcons::make()->classicLight();FontAwesomeIcons::make()->classicThin();FontAwesomeIcons::make()->duotoneSolid();FontAwesomeIcons::make()->sharpSolid();FontAwesomeIcons::make()->sharpRegular();FontAwesomeIcons::make()->sharpLight();FontAwesomeIcons::make()->sharpThin();FontAwesomeIcons::make()->sharpDuotoneSolid();FontAwesomeIcons::make()->brands();
If you need to override certain icons to use a different style, you can use either icon aliases or direct icon names.
Use the overrideStyleForAlias
method with a Filament Icon Alias. This method works with either a single icon key (string) or multiple icon keys (array).
// Override a single icon keyFontAwesomeIcons::make()->overrideStyleForAlias('tables::actions.filter', 'classicThin'); // Override multiple icon keys at onceFontAwesomeIcons::make()->overrideStyleForAlias([ 'tables::actions.filter', 'actions::delete-action',], 'classicThin');
Use the overrideStyleForIcon
method with the actual FontAwesome icon name. Like the alias method, this works with either a single icon name or multiple names.
// Override a single iconFontAwesomeIcons::make()->overrideStyleForIcon('font-awesome-user', 'classicThin'); // Override multiple icons at onceFontAwesomeIcons::make()->overrideStyleForIcon([ 'font-awesome-user', 'font-awesome-caret-up',], 'classicThin');
If you are using the free version of Font Awesome, you'll be limited in your style choices since the free version only includes a limited number of icons. To handle this gracefully, you can add the free()
method to the plugin which will automatically fallback to Classic Solid for any icons that don't exist in Classic Regular style:
...->plugin( FontAwesomeIcons::make()->classicRegular()->free())...
If you are using a paid version of Font Awesome, be sure to follow the additional steps listed in the blade-fontawesome repo.
The MIT License (MIT). Please see License for more information.