change background color for select column base on value
Is there any way i can make the select backgroud color change base on its value.. something like this
'Domain Pending' => 'red',
'Domain Locked' => 'purple',
'Domain Purchased' => 'indigo',
'Work In Progress' => 'amber',
'Done' => 'green',
'Cancel' => 'gray',
4 Replies
Wouldn’t a livewire component with custom CSS where you change the color in its blade do the trick?
Put variables in the CSS which is defined in the livewire component based on the value of the field.
I don't think there's an 'easy' way, like the one you described, but you can add custom HTML to the options
https://filamentphp.com/docs/3.x/forms/fields/select#allowing-html-in-the-option-labels
I don't think allowhtml will work on table .
Let me try this .
If this doesn’t work, you should give the HTML thing a try as you can put functions and variables in there.
Matter fact, if that works i would prefer that over what I suggested.