© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
7 replies
Emaz

extraAttributes on Groups

Is it possible to give my group headings extraAttributes so I can give them some color? I'd like to have the description font be red for urgent.

    ->groups([
        Group::make('priority')
        ->getDescriptionFromRecordUsing(fn (ToDo $record): string => match ($record->priority) {
            '1. Urgent' => 'Needs to be done ASAP',
            '2. Easy' => 'A fast task you can knock off your list',
            '3. Short Term' => 'An ordinary task that can be done soon',
            '4. Long Term' => 'Requires more planning, time and possibly resources',
            default => 'Unknown priority', // Handle any other values

        })
        ->titlePrefixedWithLabel(false),
    ])
    ->groups([
        Group::make('priority')
        ->getDescriptionFromRecordUsing(fn (ToDo $record): string => match ($record->priority) {
            '1. Urgent' => 'Needs to be done ASAP',
            '2. Easy' => 'A fast task you can knock off your list',
            '3. Short Term' => 'An ordinary task that can be done soon',
            '4. Long Term' => 'Requires more planning, time and possibly resources',
            default => 'Unknown priority', // Handle any other values

        })
        ->titlePrefixedWithLabel(false),
    ])
Screenshot_2023-10-14_at_10.11.02_AM.png
Solution
In case anyone stumbles on this, the only way I was able to make it work was:

1. custom theme
2. In that theme I had to have a selector geared towards that specific text color that was rendering. I basically set classes using recordClasses and then in my theme css I had to have a very specific selector:
.task-urgent .text-gray-950  {
    @apply !text-red-600;
}
.task-urgent .text-gray-950  {
    @apply !text-red-600;
}

The key was including that default gray text color.
Jump to solution
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

extraAttributes on Form components
FilamentFFilament / ❓┊help
3y ago
extraAttributes to reformat hint on checkbox?
FilamentFFilament / ❓┊help
2y ago
Prevent extraAttributes escaping
FilamentFFilament / ❓┊help
2y ago
extraAttributes in v3
FilamentFFilament / ❓┊help
2y ago