Filament Icons

Replace Filament's default Heroicons with the icon set you prefer. The core package behind FilaFly's Phosphor, Font Awesome, Iconoir, Carbon and Hugeicons packs.

4.x 5.x
Filament Icons

What it does

Filament Icons is the core package behind FilaFly's icon packs. It replaces Filament's default Heroicons with the icon set you prefer, and gives you one place to manage them:

  • One switch for the whole panel: every icon Filament draws comes from your chosen set.
  • Styles: switch between an icon set's styles (for example regular, solid or light) with a single method call.
  • Overrides: change the icon for any Filament alias, or replace one icon with another everywhere.
  • Your own sets: wrap any icon library that has a Blade Icons package.

Pick an icon set

Most people never install this package directly. Install one of the ready-made sets and it comes along automatically:

Community set: Solar by W84T.

Requirements

  • PHP 8.2+
  • Filament v4 or v5 (for Filament v3, use the package's 1.x branch)

Create your own icon set

The quickest way is the Filament Icons Template repository: click "Use this template" and follow its instructions.

To build one by hand, install the core package:

composer require filafly/filament-icons

Then create an enum of your icons (with the style baked into each case name, like SearchRegular and SearchSolid) and a class that extends Filafly\Icons\IconSet, mapping Filament's icon aliases to your enum:

use App\Enums\MyIcon;
use App\Enums\MyIconStyle;
use Filafly\Icons\IconSet;

class MyIcons extends IconSet
{
    protected string $pluginId = 'vendor-filament-my-icons';

    protected mixed $iconEnum = MyIcon::class;

    protected mixed $styleEnum = MyIconStyle::class; // optional

    protected array $iconMap = [
        'panels::global-search.field' => MyIcon::SearchRegular,
        'panels::pages.dashboard.actions.filter' => MyIcon::SearchSolid,
        // ...
    ];
}

Register it in your panel like any plugin: ->plugin(MyIcons::make()).

Styles and overrides

Every icon set built on Filament Icons gets the same methods:

MyIcons::make()->style('solid');   // or ->solid(), ->regular() if the set has styles

MyIcons::make()->overrideAlias('panels::global-search.field', MyIcon::SearchSolid);
MyIcons::make()->overrideIcon(MyIcon::SearchRegular, MyIcon::SearchSolid);
MyIcons::make()->overrideStyleForAlias('panels::global-search.field', 'solid');

Exact overrides win over style overrides, which win over the global style, which wins over the default map. The full reference is in the README on GitHub.

Free and open source under the MIT license.

Have questions about Filament Icons? Get help in our Discord community.

FilaFly also makes premium themes for Filament panels: Lucent, Prizm, Cypher and Citrus. Browse the themes.