© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
23 replies
Albert Lens

Custom Row Classes - How to assign a different background color to each row (Category)

Hello.
I have a resource where the user assigns a special color of his choice (with ColorPicker::make()) and I would like in the list (table) to show every row with that color in the background (opacity 50%). I have tried, but it is not working because it seems that only tailwind predefined classes can be used.
I have used these examples in:
https://filamentphp.com/docs/3.x/tables/advanced#custom-row-classes

and changed to:
->recordClasses(fn (Category $record) => match ($record->color) {
                default => 'background-color: ' . $record->color,
            })
->recordClasses(fn (Category $record) => match ($record->color) {
                default => 'background-color: ' . $record->color,
            })


Any ideas whether this can be possible?
Thank you.
image.png
Advanced - Table Builder - Filament
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Custom row classes
FilamentFFilament / ❓┊help
2y ago
change row background color
FilamentFFilament / ❓┊help
2y ago
change row background color
FilamentFFilament / ❓┊help
2y ago
custom component background color
FilamentFFilament / ❓┊help
9mo ago