Widget Color()
I'm doing some initial work with Widgets and it seems the
->color()
function isn't working for me.
Here is how I'm using it:
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!15 Replies
The only part that can be colored is the description i think.
This is what I had been reading:
https://filamentphp.com/docs/3.x/widgets/stats-overview#changing-the-color-of-the-stat
Yeah i am looking at it right now
Looks like it states that you can color the widget
But in V2 this wasn't possible
So i don't think they updated this for V3
There is a separate descriptionColor. I hadn't used Filament until v3 so I have no baseline unfortunately.
Are you saying the docs are just talking about planned features?
I just think the docs are wrong
GitHub
filament/packages/widgets/resources/views/stats-overview-widget/sta...
A collection of beautiful full-stack components for Laravel. The perfect starting point for your next app. Using Livewire, Alpine.js and Tailwind CSS. - filamentphp/filament
If you look at the code i don't see any possibility for a color beside the description one
Agreed
Hmm
I guess make a PR to change the docs or upgrade the view to make it possible to color the stat itself.
I was thinking to do the second. Not contributed yet. Don't have the local copy setup yet.
Those existing methods to calculate the color has me 👀
correct, color is only used for the description
color() is just an alias for descriptionColor() and chartColor() together
i think?
so you dont have to set them both at once
Anyone solved it? I'm trying to colorize my Stat value lol
Solution
value
or label
Genius!!!! Thanks man
@Chris Reed i think that the guy solved our problem. You can tag this Question as solved
Done, I had totally forgotten about this 🙂