adelali / filament-cards-select
Card-style radio and checkbox list components for Filament
Package info
github.com/3adeling/filament-cards-select
Language:Blade
pkg:composer/adelali/filament-cards-select
v0.1.1
2025-12-09 20:54 UTC
Requires
- php: ^8.2
- filament/forms: ^4.0
- spatie/laravel-package-tools: ^1.16
README
Card-style radio and checkbox list components for Filament v4.
Installation
You can install the package via composer:
composer require adelali/filament-cards-select
Usage
Basic Radio Selection
use Adelali\FilamentCardsSelect\Forms\Components\CardRadio; CardRadio::make('plan') ->options([ 'basic' => 'Basic Plan', 'pro' => 'Pro Plan', 'enterprise' => 'Enterprise Plan', ])
With Descriptions
CardRadio::make('plan') ->options([ 'basic' => 'Basic Plan', 'pro' => 'Pro Plan', 'enterprise' => 'Enterprise Plan', ]) ->descriptions([ 'basic' => 'Perfect for individuals getting started', 'pro' => 'For growing teams and businesses', 'enterprise' => 'Custom solutions for large organizations', ])
Multiple Selection (Checkbox List)
CardRadio::make('features') ->multiple() ->options([ 'sso' => 'Single Sign-On', 'api' => 'API Access', 'support' => 'Priority Support', ])
Or use the alias:
CardRadio::make('features') ->checkboxList() ->options([...])
Boolean Selection
CardRadio::make('is_active') ->boolean('Active', 'Inactive')
Grid Columns
Control the number of columns in the grid:
CardRadio::make('plan') ->options([...]) ->columns(2)
Responsive columns with breakpoints:
CardRadio::make('plan') ->options([...]) ->columns([ 'default' => 1, 'sm' => 2, 'md' => 3, 'lg' => 4, ])
Inline Layout
Display options inline:
CardRadio::make('plan') ->options([...]) ->inline()
Disabling Options
CardRadio::make('plan') ->options([ 'basic' => 'Basic Plan', 'pro' => 'Pro Plan', 'enterprise' => 'Enterprise Plan', ]) ->disableOptionWhen(fn (string $value): bool => $value === 'enterprise')
Requirements
- PHP 8.2+
- Filament v4
License
The MIT License (MIT). Please see License File for more information.