Badge Component

Im wanting to create a view field on a form with some badges. Should i not be able to simply do something like this that i do with other components? Right now its saying it cant find the component.
<x-filament::badge
:color="$color"
{{ $formattedState }}
</x-filament::badge>
<x-filament::badge
:color="$color"
{{ $formattedState }}
</x-filament::badge>
10 Replies
awcodes
awcodes2y ago
It definitely exists. It’s in the support package so should be available everywhere.
Kenneth Sese
Kenneth Sese2y ago
Your missing the closing > tag
awcodes
awcodes2y ago
Good catch.
Mark Chaney
Mark ChaneyOP2y ago
I get Unable to locate a class or view for component [filament::badge]. if i do
<x-filament::badge
color="info">
{{ $getRecord()->causer->role }}
</x-filament::badge>
<x-filament::badge
color="info">
{{ $getRecord()->causer->role }}
</x-filament::badge>
in a ViewField
awcodes
awcodes2y ago
Are you on the latest filament. It didn’t exist until a few versions ago. If you’re still on alpha. Pretty sure it doesn’t exist there.
Mark Chaney
Mark ChaneyOP2y ago
I just assumed it was already there because badges have existed forever. guess i should have looked closer.
Kenneth Sese
Kenneth Sese2y ago
Curious, what version are you on? If you’re on alpha is it to use LW2?
Mark Chaney
Mark ChaneyOP2y ago
@archilex yep, need to stay on that a bit longer until LW3 is a bit stable. Im on alpha131. Not technically supported of course.
Kenneth Sese
Kenneth Sese2y ago
Understandable…hopefully soon with the new stable release just out. Still some pending issues IMO however.
awcodes
awcodes2y ago
I agree.

Did you find this page helpful?