© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•8mo ago•
2 replies
Abdullah

change the color of the tabs

Excuse me, can I change the color of the tabs and make them look like a badge for filtering by color
public function getTabs(): array
{
$colors = Patient::distinct('file_colors')->pluck('file_colors');

$tabs = [
'all' => Tab::make('الكل')
->icon('heroicon-o-list-bullet'),
];

foreach ($colors as $color) {
$label = $this->getColorLabel($color);
$badgeColor = $this->getBadgeColor($color);
$hex = $this->getHexColor($color);

$tabs[$color] = Tab::make($label)
->modifyQueryUsing(fn(Builder $query) => $query->where('file_colors', $color))
->badge(Patient::where('file_colors', $color)->count())
->badgeColor($badgeColor)
->extraAttributes([
'style' => "background-color: $hex; color: #000 !important;",
'class' => 'patient-filter-tab',
]);
}

return $tabs;
}
Screenshot_2025-05-31_202735.png
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

Change the color of the widget
FilamentFFilament / ❓┊help
3y ago
How to change the color of buttons
FilamentFFilament / ❓┊help
2y ago
Change the ColumnTag color
FilamentFFilament / ❓┊help
3y ago
Change Color
FilamentFFilament / ❓┊help
2y ago