Download the PHP package filafly/filament-icons without Composer
On this page you can find all versions of the php package filafly/filament-icons. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package filament-icons
A package to replace Filament's default Heroicons with your preferred icon set, providing unified icon management with style variations and overrides.
Features
- Unified Icon Management: Standardize all icons across your Filament project.
- Style Variations: Switch between icon styles (e.g.,
solid
,regular
,light
) with a single method call. - Granular Overrides: Override specific icons or aliases at the global or component level.
- Extensible: Easily create your own icon set implementations for any icon library with a Blade Icons package.
- Developer-Focused: Designed for developers creating icon set implementations, not just end-users.
Available Icon Sets
The following icon sets are available as separate packages that work with this core package:
Official Implementations
Community Implementations
- (none yet...)
Creating Your Own Icon Set
This package allows you to create your own icon set implementations, enabling you to integrate any icon library that has a Blade Icons implementation with Filament. Here's how to get started:
Requirements
- An icon set with a Blade Icons implementation. If one doesn't exist, you'll need to create it.
- Your project must use Filament v3. For Filament v2, use the
1.x
branch of this package.
Implementation Steps
1. Define the Icon Enum
Create a PHP enum that defines all icons in your set. The enum cases should have styles baked into their names (e.g., SearchRegular
, SearchSolid
).
2. (Optional) Define the Style Enum
If your icon set supports multiple styles (e.g., regular, solid, duotone), create a StyleEnum
that implements Filafly\Icons\Contracts\StyleEnum
. This ensures your enum provides the necessary methods for the style system.
3. Create the IconSet Class
Create a class that extends Filafly\Icons\IconSet
. This class will manage your icon set's integration with Filament.
Icon Prefix: The system automatically guesses the icon prefix from your
$iconEnum
's class name (e.g.,MyIcon
becomesmyicon
). If your Blade Icons package uses a different prefix, set it with$iconPrefix
.
4. Map Filament Icon Aliases
In your IconSet
class, map Filament's icon aliases to your icon enum cases in the $iconMap
array.
Advanced Usage
The IconSet
class provides powerful methods for style transformations and granular overrides.
Global Styling
You can set a global style for all icons in your set. This is useful for applying a consistent look across your application.
Using the style()
method:
Using dynamic style methods:
If you have a StyleEnum
defined, you can use dynamic methods named after your styles:
Granular Overrides
Overrides allow you to change icons for specific aliases or replace one icon with another. The override precedence is:
- Exact Overrides:
overrideAlias()
andoverrideIcon()
- Style Overrides:
overrideStyleForAlias()
andoverrideStyleForIcon()
- Global Style:
style()
or dynamic methods - Default: The original mapping in
$iconMap
overrideAlias(string $alias, mixed $iconCase)
Overrides a specific Filament alias to use a different icon.
overrideAliases(array $overrides)
Overrides multiple aliases at once.
overrideIcon(mixed $fromIconCase, mixed $toIconCase)
Replaces one icon enum case with another across all its uses.
overrideIcons(array $overrides)
Replaces multiple icons at once.
overrideStyleForAlias(string|array $aliases, string|object $style)
Applies a specific style to one or more aliases.
overrideStyleForIcon(mixed $iconCases, string|object $style)
Applies a specific style to one or more icon enum cases.
License
The MIT License (MIT). Please see License File for more information.