© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
25 replies
Shavik

Widget Color()

I'm doing some initial work with Widgets and it seems the
->color()
->color()
function isn't working for me.

Here is how I'm using it:

<?php

namespace App\Filament\Widgets;

use Filament\Widgets\StatsOverviewWidget as BaseWidget;
use Filament\Widgets\StatsOverviewWidget\Stat;

class AgentFinancialOverview extends BaseWidget
{
    protected function getStats(): array
    {
        return [
            Stat::make('Amount Billed', '$11.2k')
                ->icon('heroicon-o-arrow-trending-up'),
            Stat::make('LOI Pending', '$2.1k')
                ->icon('heroicon-o-clipboard'),
            Stat::make('Uncollected', '$1.4k')
                ->color('danger')
                ->icon('heroicon-o-currency-dollar'),
        ];
    }
}
<?php

namespace App\Filament\Widgets;

use Filament\Widgets\StatsOverviewWidget as BaseWidget;
use Filament\Widgets\StatsOverviewWidget\Stat;

class AgentFinancialOverview extends BaseWidget
{
    protected function getStats(): array
    {
        return [
            Stat::make('Amount Billed', '$11.2k')
                ->icon('heroicon-o-arrow-trending-up'),
            Stat::make('LOI Pending', '$2.1k')
                ->icon('heroicon-o-clipboard'),
            Stat::make('Uncollected', '$1.4k')
                ->color('danger')
                ->icon('heroicon-o-currency-dollar'),
        ];
    }
}

Output of this is attached.

When I added descriptions and description colors those worked so not sure why the widget 'color' itself isn't.

Thanks for any insight!
3kphEEX.png
Solution
value
value
or
label
label

->value(new HtmlString('<span class="text-danger-600">Value</span>'))
->value(new HtmlString('<span class="text-danger-600">Value</span>'))
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

Change widget icon color
FilamentFFilament / ❓┊help
16mo ago
Panel primary color in widget
FilamentFFilament / ❓┊help
3y ago
change widget's background color
FilamentFFilament / ❓┊help
3y ago
Change the color of the widget
FilamentFFilament / ❓┊help
3y ago