alkoumi/filament-image-radio-button

Filament Form Radio Button But With Images
3,575 6
Install
composer require alkoumi/filament-image-radio-button
Latest Version:v2.0.3
PHP:^8.2|^8.3|^8.4
License:MIT
Last Updated:May 19, 2026
Links: GitHub  ·  Packagist
Maintainer: alkoumi

Filament Image Radio Button

A Filament form component that replaces traditional radio buttons with image selection. Supports RTL and Dark Mode.

Total Downloads Packagist Stars License Latest Version on Packagist GitHub Tests Action Status

Demo

Requirements

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

Installation

composer require alkoumi/filament-image-radio-button

Theme Setup (Filament 4+)

  1. Create a custom theme: Filament Docs

  2. Add the package views to your theme CSS:

@source '../../../../vendor/alkoumi/filament-image-radio-button/resources/views/**/*.blade.php';
  1. Register the theme in your Panel Provider:
->viteTheme('resources/css/filament/admin/theme.css')
  1. Build assets:
npm run build

Usage

Basic Usage

use Alkoumi\FilamentImageRadioButton\Forms\Components\ImageRadioGroup;

ImageRadioGroup::make('report_id')
    ->disk('reports')
    ->options(fn () => Report::pluck('file', 'id')->toArray())

Full API

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

Dynamic Options

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()

Configuration

Storage Disk Setup

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 Format

Options must be an array where:

  • Key: The value to store (e.g., model ID)
  • Value: The image path relative to the disk
// Example: ['1' => 'storage/template1.jpg', '2' => 'storage/template2.png']
Report::pluck('image_path', 'id')->toArray()

Screenshots

Modes

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.

Related Packages

alkoumi/filament-n8n-chat

A seamless integration of n8n chat widget into your FilamentPHP applications

504 8
bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

5,584,197 2,827
shuvroroy/filament-spatie-laravel-health

This plugin is built on top of Spatie's Laravel-health package

987,070 197
pxlrbt/filament-excel

Supercharged Excel exports for Filament Resources

3,153,481 460

Version History

Version Released PHP License
v2.0.3 ^8.2|^8.3|^8.4 MIT
v2.0.2 ^8.2|^8.3|^8.4 MIT
2.0.0 ^8.2|^8.3|^8.4 MIT
v1.1.7 ^8.1|^8.2|^8.3|^8.4 MIT
v1.1.6 ^8.1|^8.2|^8.3|^8.4 MIT