Adding CSS to table group label/name

How can I add formatting such as bolt text or a specific color, a border/background, etc to the lables a table puts on groups? (when using ->defaultGroup(Tables\Grouping\Group::make()) There id not appear to be a ->badge() or ->html() like there was for table columns.
4 Replies
Matthew
Matthew2mo ago
You can add a default theme and control a load of 'fi-' elements via css
LeandroFerreira
LeandroFerreira2mo ago
If you want to customize the css, you should create a theme
treii28
treii28OP2mo ago
OK, but I'm not interested in changing the CSS for the entire website. I don't think this is a theme related issue. I have a single page that lays thing out using the groups. But there seems to be no way to tinker with the styling of the group heading that I can find. I just want those headings modified on this particular page. I know I can probably create a custom page and re-cycle the original template to add my own styling. I was just surprised I didn't see anything that would let you do anything more than specify what the group name would come from. There's no way to style that outside of theming the entire site or overriding the entire behavior? Seriously?? Furthermore, I might want to change it up on different view pages. The project I'm playing with to learn more about filament has three primary categorizations. Think of them as 'people', 'locations' and 'items'. Each item relates to a location. Each person can relate to items. So one list might have 'items by location', another 'items by person'. Still another way of viewing it might be to group by 'items related to people' than group those 'items by location' under each person. To make things more visually consistent, I might want to make location names Yellow, people names Green, items names Blue for example. So that regardless which is higher or lower in the heirarchy on any given page/view, the colors match so you can quickly pick out which is which. The point being, it will vary by page. Theming 'group heading' sitewide won't achieve this. An ability to specify a color or typeface in the group definition for each page would.
Matthew
Matthew2mo ago
You don't have to rewrite the whole thing? Create the tailwind components you need and apply in the extraAttributes where applicable. Also....look into badges.
Want results from more Discord servers?
Add your server