owenvoke / blade-fontawesome

A package to easily make use of Font Awesome in your Laravel Blade views.
https://packagist.org/packages/owenvoke/blade-fontawesome
MIT License
162 stars 27 forks source link

Use alternative syntax? #76

Closed ssssteve closed 3 months ago

ssssteve commented 4 months ago

Description

blade-ui-kit allows alternative syntax using for accessing icons:

@svg('camera', 'icon-lg')

Is there any alternative syntax here? My use case is this: I have a number of different icons depending on a config array. I'd like to call the icon programmatically using a variable rather than specifically via a component.

Possible implementation

<x-fas-users/>

versus

@svg($menuIcon, ['class' => 'icon-lg'])

owenvoke commented 4 months ago

I'm pretty sure that should just work. This packages uses Blade Icons under the hood. So I think just using @svg should work.

@svg('fas-cloud', 'w-6 h-6')