jeffersongoncalves/filament-flux
Filament v5 plugin that exposes Livewire Flux UI components as native Filament Form fields, Table columns, Infolist entries, and Actions. Includes an installer to patch panel theme CSS and add Flux + Filament Flux styles.
Install the package:
composer require jeffersongoncalves/filament-flux
php artisan make:filament-theme admin
php artisan filament-flux:install --panel=admin
npm run build
Register the plugin in your Panel provider:
public function panel(Panel $panel): Panel
{
return $panel->plugins([
FilamentFluxPlugin::make(),
]);
}
First use case: Replace a single form field in a Resource:
use Jeffersongoncalves\FilamentFlux\Forms\Components\FluxInput;
FluxInput::make('email')
->email()
->required();
filament-flux CSS is injected (check resources/css/filament/{panel}/theme.css).Settings page).useEverywhere() cautiously—start with granular replacements.Start with forms: Replace TextInput, Select, or Checkbox in a Resource:
FluxInput::make('name')
->fluxIcon('user')
->fluxClearable();
Extend existing fields: Flux fields inherit Filament’s methods (e.g., ->relationship()) but add Flux-specific methods:
FluxSelect::make('status')
->options(['active', 'inactive'])
->searchable()
->fluxVariant('pills'); // Flux-specific
Table columns: Replace BadgeColumn with FluxBadgeColumn:
FluxBadgeColumn::make('status')
->fluxColor(['active' => 'lime', 'inactive' => 'zinc'])
->fluxIcon('check-circle');
Navigation: Opt into Flux navigation incrementally:
FilamentFluxPlugin::make()->useFluxNavigation([
'sidebar' => true,
'topbar' => false,
]);
useEverywhere() with opt-outs for specific fields:
FilamentFluxPlugin::make()->useEverywhere([
'select' => false, // Keep Filament’s select for legacy integrations
]);
resources/views/filament/ to extend Flux components (e.g., flux::dropdown).| Use Case | Flux Component | Filament Equivalent | Key Methods |
|---|---|---|---|
| Form input | FluxInput |
TextInput |
fluxIcon(), fluxClearable() |
| Multi-select | FluxCheckboxGroup |
CheckboxList |
fluxVariant('cards') |
| Toggle switch | FluxSwitch |
Toggle |
fluxAlign('right') |
| Table badge | FluxBadgeColumn |
BadgeColumn |
fluxColor(), fluxIcon() |
| Navigation item | <flux:navlist.item> |
<x-filament::sidebar.item> |
Custom Blade markup |
CSS Conflicts:
zinc scale (not Filament’s gray). Replace gray-* with zinc-* in custom CSS.theme.css or use fluxColor() methods to map Filament colors to Flux.Missing Features:
pageOptions dropdown in pagination. Disable the pagination component if needed:
FilamentFluxPlugin::make()->useFluxComponents(['pagination' => false]);
Icon System:
fluxIcon() calls. Filament’s icon() method won’t work.HeroiconNormalizer for mixed icon sets (e.g., fluxIcon('heroicon-o-user')).Modal Limitations:
<flux:modal>. Use Filament’s native modals for actions:
FluxAction::make('delete')
->requiresConfirmation()
->action(...);
Performance:
useFluxComponents(['badge' => false])).flux.appearance or flux.toast warnings. Ensure @fluxScripts is injected:
FilamentFluxPlugin::make()->injectScripts(true);
resources/views/filament/ overrides exist. Fallback to vendor views:
php artisan vendor:publish --tag=filament-flux-views
Custom Flux Components:
Extend Jeffersongoncalves\FilamentFlux\Forms\Components\FluxField to create domain-specific fields:
class CustomFluxField extends FluxField {
protected static string $view = 'filament-flux::forms.custom-field';
}
Theme Customization:
Override Flux’s default theme variables in resources/css/filament-flux.css:
@layer flux-components {
.flux-input {
--flux-input-border-color: #e5e7eb;
}
}
Livewire Events: Dispatch Flux-specific events for custom interactions:
$this->dispatch('flux-toast', toast: [
'title' => 'Success',
'message' => 'Action completed',
]);
Render in your layout:
<x-flux::toast.group />
->fluxLabel() for custom labels:
FluxInput::make('name')->fluxLabel('Full Name');
x-flux-locale directives. Use app()->setLocale() in your Panel provider:
app()->setLocale('es');
How can I help you explore Laravel packages today?