asignua/filament-toggle-icon-column
A Filament table column that renders a boolean value as a clickable icon, letting you toggle the state inline straight from the table row. Drop it into any Filament resource to replace clunky switches with a compact, customizable icon toggle with configurable colors.
composer require and, if the package registers a Filament plugin, add it to your panel provider's ->plugins([...]) array; otherwise just reference the column class in a table.php artisan filament:assets immediately after installing or updating. As of v1.0.1 the colour support ships as a small stylesheet; without republishing, onColor(), offColor() and hoverColor() are silently inert and every icon renders grey.ToggleIconColumn::make('is_active')->onColor('success')->offColor('gray'), so an admin can flip a flag without opening an edit modal.is_active, is_featured, is_visible-style flags, and keep a plain IconColumn or badge TextColumn on read-only relation managers so non-editing contexts stay cheap.->disabled(fn ($record) => ! auth()->user()->can('update', $record)) (or hide it) — the column issues a Livewire round-trip and Laravel policy checks still run server-side, but a disabled icon is clearer UX than a 403 flash.success, danger, warning, info, gray map onto Filament's --text / --dark-text CSS variables. Hardcoded hex values or your own .fi-icon rules will fight the shipped stylesheet and usually lose.php artisan filament:assets (plus view:clear) to your release script and CI, right after composer install. This is the single operational change v1.0.1 introduces — treat it like filament:upgrade and forget it at your peril.filament:assets publishes package assets but does not compile them into your resources/css/filament/* bundle.php artisan filament:assets, php artisan view:clear, then hard-refresh the browser. Filament's own CSS only paints .fi-ta-icon > .fi-icon.fi-color; the plugin's markup isn't matched by it, which is exactly the bug v1.0.1 fixes.^1.0.1. On v1.0.0 the colour methods are effectively a no-op — if your UI uses colour to encode state, 1.0.0 is a silent accessibility regression, not just a cosmetic one.--text / --dark-text resolve to. If you have overridden those variables globally for contrast reasons, your toggle icons change with them; don't patch the plugin stylesheet, adjust the variables.<svg> should carry both fi-icon and fi-color, with a text-custom-*/text-{color}-* class from the plugin's CSS variables. If fi-color is absent, the colour argument isn't reaching the column — check the make() name and the record's attribute cast (boolean, not "1"/"0" string comparisons).@layer or overriding via Filament's ->colors() panel config is safe; rewriting the selectors is not.How can I help you explore Laravel packages today?