Toggle button in InfoList

How can I add toggle component to show or hide null value in InfoList?

I have a lot of data row and it would be better if there is a toggle button that allow users to hide or show empty row.

Currently here is my code that only hide null value.

...
TextEntry::make('name')->hidden(fn ($state) => is_array($state)),
TextEntry::make('email')->hidden(fn ($state) => is_array($state)),
TextEntry::make('phone')->hidden(fn ($state) => is_array($state)),
...


How can I add toggle button to show/hide back the row.
Was this page helpful?