How do I could add an icon to filament filters reset action? #20475
Replies: 1 comment 1 reply
|
I asked Claude to lay out my solution in a straightforward, step-by-step manner, so this should be pretty easy to follow. Let me know if you need any extra help. 1. Where it actually lives. {{-- Header position --}}
<x-filament::link :attributes="... new ComponentAttributeBag([
'color' => 'danger',
'tag' => 'button',
'wire:click' => 'resetTableFiltersForm',
]) ...">
{{-- Footer position --}}
<x-filament::button color="danger" wire:click="resetTableFiltersForm">So there is nothing to call 2. If you use the modal layout, you can. That's the one place reset is a real action — use Filament\Actions\Action;
use Filament\Support\Icons\Heroicon;
use Filament\Tables\Enums\FiltersLayout;
->filtersLayout(FiltersLayout::Modal)
->filtersTriggerAction(fn (Action $action) => $action->extraModalFooterActions([
$this->getTable()->getFiltersApplyAction()->close(),
Action::make('resetFilters')
->label(__('filament-tables::table.filters.actions.reset.label'))
->icon(Heroicon::ArrowPath)
->color('danger')
->action('resetTableFiltersForm')
->button(),
]))
3. Dropdown or above-content layout: publish the view. Both then in 4. Know the cost. A published view is pinned to the version you published from (5.8.1 here) and you own it through every upgrade — for one icon that's a real tax. If you don't need it today, prefer the modal route or an issue asking for a |
Uh oh!
There was an error while loading. Please reload this page.
Package
Table builder
Package Version
v5.8.1
How can we help you?
Currently there is no option where i could add an icon to filament filters reset action
All reactions