How can I hide a Filament dashboard widget completely based on filters? #18039
Unanswered
Gerrit-JanvanderBos
asked this question in
Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Package
Panel builder
Package Version
v4
How can we help you?
H,
I’m building a Filament Dashboard with multiple widgets. I want some widgets (for example, a GenderChart widget) to disappear dynamically in certain situations.
When I filter on gender and only one of two data types is present, the chart becomes unnecessary because it would only have a single dataset. I can currently return an empty dataset like this:
The problem is that the widget still renders on the dashboard — including its title and container — even with an empty dataset.
My question:
Is it possible in Filament to completely hide a dashboard widget based on filters, so that it doesn’t render at all if the chart is not needed? I’d like the widget visibility to react immediately when filters are applied, without requiring a full page refresh.
Any guidance, examples, or best practices would be greatly appreciated!
Beta Was this translation helpful? Give feedback.
All reactions