Icons best practices
I'd like more icon options to choose from. So I investigated some. And what I'm doing now is:
- Search icon here: https://blade-ui-kit.com/blade-icons?search=list&set=1#search
- If it's a icon package I don't have yet, install it with this: https://github.com/blade-ui-kit/blade-icons
- Profit
Is this the way to go?
Also, I think I can't use Heroicon v2 icons, because Filament 2 is depending on v1 icons? Or is there a way around that?
Any other tips in general for me and others that wish to use more icons than the default heroicons?
9 Replies
Hi @john.77 , the simplest option that comes to mind for custom icons would be to create custom Blade components with SVG. For exampe, if you have a custom component
resources/views/components/custom-icons/yes.blade.php
, you could use it anywhere Filament expects a heroicon-...
expression :
But I don't know anything about best practices in this case... πbest practice is dont install the huge icon sets like font awesome
they will slow your app down massively
What about caching them?
I'll give that a shot!
the slow part is not affected my caching much
I figured that the slow part was due to component magic and finding the right icon. If not that, and also not network traffic or computations, why slow?
registering many blade components on every request
thousands in some sets
Ah.. I see.
in filament v3 we move away from using the blade components
and disable them so its more performant
Nice! Looking forward to it.
I now copy the svg directly from Blade UI Kit, just adding
class="{{ $class }}"
, and creating custom components. Works great! Thanks @pboivin and @Dan Harrin !