| Install | |
|---|---|
composer require alkoumi/filament-image-radio-button |
|
| Latest Version: | 2.0.0 |
| PHP: | ^8.2|^8.3|^8.4 |
A Filament form component that replaces traditional radio buttons with image selection. Supports RTL and Dark Mode.

| Version | PHP | Filament | Livewire | Laravel |
|---|---|---|---|---|
| 2.x | 8.2+ | 3.x, 4.x, 5.x | 3.x, 4.x | 10.x, 11.x, 12.x |
| 1.x | 8.1+ | 3.x, 4.x | 3.x | 10.x, 11.x |
composer require alkoumi/filament-image-radio-button
Create a custom theme: Filament Docs
Add the package views to your theme CSS:
@source '../../../../vendor/alkoumi/filament-image-radio-button/resources/views/**/*.blade.php';
->viteTheme('resources/css/filament/admin/theme.css')
npm run build
use Alkoumi\FilamentImageRadioButton\Forms\Components\ImageRadioGroup;
ImageRadioGroup::make('report_id')
->disk('reports')
->options(fn () => Report::pluck('file', 'id')->toArray())
use Alkoumi\FilamentImageRadioButton\Forms\Components\ImageRadioGroup;
ImageRadioGroup::make('report_id')
->label(__('Report Design'))
->required()
->disk('reports') // Storage disk name
->options(fn () => [...]) // Array of [ id => image_path ]
->gridColumns(4) // Number of columns (default: 3)
->live() // Enable live updates
ImageRadioGroup::make('report_id')
->disk('reports')
->options(fn (Get $get) => Report::whereType($get('type_id'))->pluck('file', 'id')->toArray())
->afterStateUpdated(fn (Get $get, Set $set, ?string $state) =>
$set('selected_report', Report::find($state))
)
->live()
Define a disk in config/filesystems.php:
'reports' => [
'driver' => 'local',
'root' => storage_path('app/public/reports'),
'url' => env('APP_URL') . '/storage/reports',
'visibility' => 'public',
],
Options must be an array where:
// Example: ['1' => 'storage/template1.jpg', '2' => 'storage/template2.png']
Report::pluck('image_path', 'id')->toArray()

Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.