PHPackages                             codewithdennis/filament-advanced-choice - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Templating &amp; Views](/categories/templating)
4. /
5. codewithdennis/filament-advanced-choice

ActiveLibrary[Templating &amp; Views](/categories/templating)

codewithdennis/filament-advanced-choice
=======================================

Beautiful, customizable radio and checkbox form layouts for FilamentPHP.

v2.1.0(1mo ago)992.4k↑283.3%9[1 issues](https://github.com/CodeWithDennis/filament-advanced-choice/issues)1MITBladePHP ^8.1CI passing

Since Jul 8Pushed 1w ago1 watchersCompare

[ Source](https://github.com/CodeWithDennis/filament-advanced-choice)[ Packagist](https://packagist.org/packages/codewithdennis/filament-advanced-choice)[ Docs](https://github.com/codewithdennis/filament-advanced-choice)[ GitHub Sponsors](https://github.com/CodeWithDennis)[ RSS](/packages/codewithdennis-filament-advanced-choice/feed)WikiDiscussions 2.x Synced 1w ago

READMEChangelog (10)Dependencies (5)Versions (13)Used By (1)

Filament Advanced Choice
========================

[](#filament-advanced-choice)

[![Latest Version on Packagist](https://camo.githubusercontent.com/32d363b6cd15b76c6f6e73bb22f0b86161bfae9d4b505f4378f4939e6c3e6c82/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f636f64657769746864656e6e69732f66696c616d656e742d616476616e6365642d63686f6963652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/codewithdennis/filament-advanced-choice)[![Total Downloads](https://camo.githubusercontent.com/6a941c54cbb6255b1297a2f4c5022ace1f1928bfeb0852829ccb7061676ea41c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f636f64657769746864656e6e69732f66696c616d656e742d616476616e6365642d63686f6963652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/codewithdennis/filament-advanced-choice)

This package introduces eight new form fields for FilamentPHP. Four of them are based on `Radio`, and four are based on `CheckboxList`.

[![Filament Advanced Choice preview](art/thumbnail.png)](art/thumbnail.png)

Requirements
------------

[](#requirements)

- Filament 4/5

Installation
------------

[](#installation)

**1.** Install with Composer:

```
composer require codewithdennis/filament-advanced-choice
```

**2.** To make sure styling works, add this to your custom FilamentPHP theme:

```
@source '../../../../vendor/codewithdennis/filament-advanced-choice/resources/**/*.blade.php';
```

**3.** Run `npm run build` or `npm run dev` so the theme rebuilds.

Components
----------

[](#components)

Prefer the singular field classes (`RadioCard`, `RadioStackedCard`, `CheckboxCard`, `CheckboxStackedCard`). The plural names (`RadioCards`, `RadioStackedCards`, `CheckboxCards`, `CheckboxStackedCards`) remain as deprecated aliases for backward compatibility.

### CheckboxList

[](#checkboxlist)

Vertical list layout with descriptions for multiple selections.

[![CheckboxList](art/basic_checkbox_list.png)](art/basic_checkbox_list.png)

```
CheckboxList::make('delivery_type')
    ->searchable()
    ->bulkToggleable()
    ->options([
        'standard' => 'Standard Delivery',
        'express' => 'Express Delivery',
        'overnight' => 'Overnight Delivery',
        'same_day' => 'Same Day Delivery',
        'economy' => 'Economy Delivery',
        'premium' => 'Premium Delivery',
        'international' => 'International Delivery',
        'local' => 'Local Delivery',
    ])
    ->descriptions([
        'standard' => 'Delivery within 5-7 business days',
        'express' => 'Delivery within 2-3 business days',
        'overnight' => 'Next day delivery available',
        'same_day' => 'Delivery on the same day',
        'economy' => 'Budget-friendly delivery option',
        'premium' => 'Premium service with tracking',
        'international' => 'Worldwide shipping available',
        'local' => 'Same city delivery service',
    ])
    ->extras([
        'standard' => '$5.00 flat rate',
        'express' => '$10.00 flat rate',
        'overnight' => '$20.00 flat rate',
        'same_day' => '$25.00 flat rate',
        'economy' => '$3.00 flat rate',
        'premium' => '$15.00 flat rate',
        'international' => '$50.00 flat rate',
        'local' => '$8.00 flat rate',
    ]);
```

### CheckboxCard

[](#checkboxcard)

Card-based layout with descriptions and extras support for multiple selections.

[![CheckboxCard](art/basic_checkbox_cards.png)](art/basic_checkbox_cards.png)

```
CheckboxCard::make('delivery_type')
    ->searchable()
    ->bulkToggleable()
    ->options([
        'standard' => 'Standard Delivery',
        'express' => 'Express Delivery',
        'overnight' => 'Overnight Delivery',
        'same_day' => 'Same Day Delivery',
        'economy' => 'Economy Delivery',
        'premium' => 'Premium Delivery',
        'international' => 'International Delivery',
        'local' => 'Local Delivery',
    ])
    ->descriptions([
        'standard' => 'Delivery within 5-7 business days',
        'express' => 'Delivery within 2-3 business days',
        'overnight' => 'Next day delivery available',
        'same_day' => 'Delivery on the same day',
        'economy' => 'Budget-friendly delivery option',
        'premium' => 'Premium service with tracking',
        'international' => 'Worldwide shipping available',
        'local' => 'Same city delivery service',
    ])
    ->extras([
        'standard' => '$5.00 flat rate',
        'express' => '$10.00 flat rate',
        'overnight' => '$20.00 flat rate',
        'same_day' => '$25.00 flat rate',
        'economy' => '$3.00 flat rate',
        'premium' => '$15.00 flat rate',
        'international' => '$50.00 flat rate',
        'local' => '$8.00 flat rate',
    ]);
```

### CheckboxStackedCard

[](#checkboxstackedcard)

Stacked card layout with descriptions and extras support for multiple selections.

[![CheckboxStackedCard](art/basic_checkbox_stacked_cards.png)](art/basic_checkbox_stacked_cards.png)

```
CheckboxStackedCard::make('delivery_type')
    ->options(DeliveryTypeEnum::class)
    ->searchable()
    ->bulkToggleable();
```

### CheckboxTable

[](#checkboxtable)

Responsive table layout with descriptions for multiple selections.

[![CheckboxTable](art/basic_checkbox_table.png)](art/basic_checkbox_table.png)

```
CheckboxTable::make('delivery_type')
    ->options(DeliveryTypeEnum::class)
    ->searchable()
    ->bulkToggleable();
```

### RadioList

[](#radiolist)

Vertical list layout with descriptions.

[![RadioList](art/basic_radio_list.png)](art/basic_radio_list.png)

```
RadioList::make('delivery_type')
    ->options(DeliveryTypeEnum::class);
```

### RadioTable

[](#radiotable)

Responsive table layout with descriptions.

[![RadioTable](art/basic_radio_table.png)](art/basic_radio_table.png)

```
RadioTable::make('delivery_type')
    ->options(DeliveryTypeEnum::class);
```

### RadioCard

[](#radiocard)

Card-based layout with descriptions and extras support.

Smallest useful example with `options()`, `descriptions()`, and `extras()`:

```
RadioCard::make('plan')
    ->options([
        'hobby' => 'Hobby',
        'pro' => 'Pro',
    ])
    ->descriptions([
        'hobby' => 'For side projects',
        'pro' => 'For teams',
    ])
    ->extras([
        'hobby' => '$9/mo',
        'pro' => '$29/mo',
    ]);
```

Same layout with a backed enum:

[![RadioCard](art/basic_radio_cards.png)](art/basic_radio_cards.png)

```
RadioCard::make('delivery_type')
    ->options(DeliveryTypeEnum::class);
```

### RadioStackedCard

[](#radiostackedcard)

Stacked card layout with descriptions and extras support.

[![RadioStackedCard](art/basic_radio_stacked_cards.png)](art/basic_radio_stacked_cards.png)

```
RadioStackedCard::make('delivery_type')
    ->options(DeliveryTypeEnum::class);
```

Search, bulk actions, and disabling options
-------------------------------------------

[](#search-bulk-actions-and-disabling-options)

These come from FilamentPHP’s `Radio` and `CheckboxList` APIs (inherited unchanged).

Search:

```
CheckboxList::make('delivery_type')
    ->options(DeliveryTypeEnum::class)
    ->searchable()
    ->searchPrompt('Search delivery types...')
    ->noSearchResultsMessage('No delivery types found.');
```

Bulk select (checkbox-style fields only):

```
CheckboxList::make('delivery_type')
    ->options(DeliveryTypeEnum::class)
    ->bulkToggleable();
```

Disable one option:

```
CheckboxList::make('delivery_type')
    ->options(DeliveryTypeEnum::class)
    ->disableOptionWhen(fn (string $value): bool => $value === 'premium');
```

Enum support
------------

[](#enum-support)

Pass a backed enum class name to `options()` instead of an array. Implement:

- `Filament\Support\Contracts\HasLabel` (main label)
- `Filament\Support\Contracts\HasDescription` (subtitle)
- `CodeWithDennis\FilamentAdvancedChoice\Filament\Interfaces\HasExtra` (`extras()` column)

**Full enum example**```
