PHPackages                             tonegabes/filament-better-options - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. tonegabes/filament-better-options

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

tonegabes/filament-better-options
=================================

Filament form components for better radio and checkbox options.

1.3.6(1mo ago)155.2k—3.3%6[2 issues](https://github.com/tonegabes/filament-better-options/issues)MITBladePHP ^8.2

Since Sep 10Pushed 1mo agoCompare

[ Source](https://github.com/tonegabes/filament-better-options)[ Packagist](https://packagist.org/packages/tonegabes/filament-better-options)[ Docs](https://github.com/tonegabes/filament-better-options)[ RSS](/packages/tonegabes-filament-better-options/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (14)Versions (20)Used By (0)

Filament Better Options
=======================

[](#filament-better-options)

[![Latest Version on Packagist](https://camo.githubusercontent.com/426b1997cfd4601fab314ca18d9426290c2f959be32634fc31f5e3755659f97f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f746f6e6567616265732f66696c616d656e742d6265747465722d6f7074696f6e732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/tonegabes/filament-better-options)[![Total Downloads](https://camo.githubusercontent.com/4b0ac8b3030c1a5bb13f6d3e056723a8d730322c602ec50e6f0dfe4c5124fe9c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f746f6e6567616265732f66696c616d656e742d6265747465722d6f7074696f6e732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/tonegabes/filament-better-options)

Enhanced form components for Filament Forms with modern interface, advanced features, and excellent performance. Provides `CheckboxList`, `CheckboxCards`, `RadioList`, and `RadioCards` with icons, visual indicators, descriptions, extra texts, search functionality, and bulk operations.

Features
--------

[](#features)

✨ **Enhanced UI Components**

- Modern card-based and list layouts
- Extensible icon system using Filament icons aliases
- Flexible icon positioning (before/after)
- Support for descriptions and extra texts
- Pre-defined themes (minimal, modern, classic)

### Advanced Features

[](#advanced-features)

- Real-time search with debounced input
- Bulk select/deselect operations for checkboxes
- Configurable positioning and visibility
- Performance-optimized JavaScript

🎨 **Extensible Architecture**

- Tailwind CSS styling with dark mode support
- Configurable default positions and icons via config file
- Full accessibility support

### Performance &amp; Caching

[](#performance--caching)

- Intelligent icon caching system
- Efficient DOM operations and caching
- Alpine.js components loaded on demand
- Minimal JavaScript footprint

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

[](#requirements)

- PHP 8.2+
- Laravel 11.28+
- Filament 5.0+
- Livewire 4.0+
- Tailwind CSS 4.0+

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

[](#installation)

Install the package via Composer:

```
composer require tonegabes/filament-better-options
```

Optionally, publish the configuration file for positioning settings:

```
php artisan vendor:publish --tag="better-options-config"
```

Optionally, publish the assets for customization:

```
php artisan vendor:publish --tag="better-options-assets"
```

Configuration
-------------

[](#configuration)

The published configuration file (`config/better-options.php`) provides customization positioning options:

```
return [
    'components' => [
        'checkbox' => [
            'list' => [
                'icon_position'      => 'after',
                'indicator_position' => 'before',
            ],
            'cards' => [
                'icon_position'      => 'before',
                'indicator_position' => 'after',
            ],
        ],
        'radio' => [
            'list' => [
                'icon_position'      => 'after',
                'indicator_position' => 'before',
            ],
            'cards' => [
                'icon_position'      => 'before',
                'indicator_position' => 'after',
            ],
        ],
    ],
];
```

Usage
-----

[](#usage)

### Basic Examples

[](#basic-examples)

[![Checkbox Cards Demo](https://raw.githubusercontent.com/tonegabes/filament-better-options/refs/heads/main/images/checkbox_cards.jpg)](https://raw.githubusercontent.com/tonegabes/filament-better-options/refs/heads/main/images/checkbox_cards.jpg)

```
use ToneGabes\BetterOptions\Forms\Components\CheckboxCards;
use ToneGabes\Filament\Icons\Enums\Phosphor;

// Checkbox Cards with default features
CheckboxCards::make('permissions')
    ->label('Permissions')
    ->columns(2)
    ->options([
        'view'   => 'View',
        'edit'   => 'Edit',
        'delete' => 'Delete',
        'create' => 'Create',
    ])
    ->descriptions([
        'view'   => 'Allows viewing the model.',
        'edit'   => 'Allows editing the model.',
        'delete' => 'Allows deleting the model.',
        'create' => 'Allows creating a new model.',
    ])
    ->icons([
        'view'   => Phosphor::Eye->thin(),
        'edit'   => Phosphor::Pencil->thin(),
        'delete' => Phosphor::Trash->thin(),
        'create' => Phosphor::Plus->thin(),
    ])
,
```

[![Checkbox List Demo](https://raw.githubusercontent.com/tonegabes/filament-better-options/refs/heads/main/images/checkbox_list.jpg)](https://raw.githubusercontent.com/tonegabes/filament-better-options/refs/heads/main/images/checkbox_list.jpg)

```
use ToneGabes\BetterOptions\Forms\Components\CheckboxList;
use ToneGabes\Filament\Icons\Enums\Phosphor;

// Checkbox List with default features
CheckboxList::make('permissions')
    ->label('Permissions')
    ->options([
        'view'   => 'View',
        'edit'   => 'Edit',
        'delete' => 'Delete',
        'create' => 'Create',
    ])
    ->descriptions([
        'view'   => 'Allows viewing the model.',
        'edit'   => 'Allows editing the model.',
        'delete' => 'Allows deleting the model.',
        'create' => 'Allows creating a new model.',
    ])
    ->icons([
        'view'   => Phosphor::Eye->thin(),
        'edit'   => Phosphor::Pencil->thin(),
        'delete' => Phosphor::Trash->thin(),
        'create' => Phosphor::Plus->thin(),
    ])
,
```

[![Radio Cards Demo](https://raw.githubusercontent.com/tonegabes/filament-better-options/refs/heads/main/images/radio_cards.jpg)](https://raw.githubusercontent.com/tonegabes/filament-better-options/refs/heads/main/images/radio_cards.jpg)

```
use ToneGabes\BetterOptions\Forms\Components\RadioCards;
use ToneGabes\Filament\Icons\Enums\Phosphor;

// Radio Cards with default features
RadioCards::make('role')
    ->label('Role')
    ->columns(2)
    ->options([
        'manager' => 'Manager',
        'editor'  => 'Editor',
        'viewer'  => 'Viewer',
        'creator' => 'Creator',
    ])
    ->descriptions([
        'manager' => 'Allows managing the model.',
        'editor'  => 'Allows editing the model.',
        'viewer'  => 'Allows viewing the model.',
        'creator' => 'Allows creating a new model.',
    ])
    ->icons([
        'manager' => Phosphor::Gear->thin(),
        'editor'  => Phosphor::Pencil->thin(),
        'viewer'  => Phosphor::Eye->thin(),
        'creator' => Phosphor::Plus->thin(),
    ])
,
```

[![Radio List Demo](https://raw.githubusercontent.com/tonegabes/filament-better-options/refs/heads/main/images/radio_list.jpg)](https://raw.githubusercontent.com/tonegabes/filament-better-options/refs/heads/main/images/radio_list.jpg)

```
use ToneGabes\BetterOptions\Forms\Components\RadioList;
use ToneGabes\Filament\Icons\Enums\Phosphor;

// Radio List with default features
RadioList::make('role')
    ->label('Role')
    ->options([
        'manager' => 'Manager',
        'editor'  => 'Editor',
        'viewer'  => 'Viewer',
        'creator' => 'Creator',
    ])
    ->descriptions([
        'manager' => 'Allows managing the model.',
        'editor'  => 'Allows editing the model.',
        'viewer'  => 'Allows viewing the model.',
        'creator' => 'Allows creating a new model.',
    ])
    ->icons([
        'manager' => Phosphor::Gear->thin(),
        'editor'  => Phosphor::Pencil->thin(),
        'viewer'  => Phosphor::Eye->thin(),
        'creator' => Phosphor::Plus->thin(),
    ])
,
```

Using Enums
-----------

[](#using-enums)

This package provides a convenient way to use PHP enums for defining options, descriptions, and icons. Here's how you can leverage enums in your component definitions:

```
use Filament\Support\Contracts\HasDescription;
use Filament\Support\Contracts\HasIcon;
use Filament\Support\Contracts\HasLabel;
use ToneGabes\BetterOptions\Contracts\HasExtraText;
use ToneGabes\Filament\Icons\Enums\Phosphor;

enum Roles: string implements HasDescription, HasExtraText, HasIcon, HasLabel {
    case Manager = 'manager';
    case Editor = 'editor';
    case Viewer = 'viewer';
    case Creator = 'creator';

    public function getDescription(): string {
        return match($this) {
            self::Manager => 'Allows managing the model.',
            self::Editor  => 'Allows editing the model.',
            self::Viewer  => 'Allows viewing the model.',
            self::Creator => 'Allows creating a new model.',
        };
    }

    public function getExtraText(): string {
        return match($this) {
            self::Manager => 'model.manager',
            self::Editor  => 'model.editor',
            self::Viewer  => 'model.viewer',
            self::Creator => 'model.creator',
        };
    }

    public function getIcon(): string {
        return match($this) {
            self::Manager => Phosphor::Gear->thin(),
            self::Editor  => Phosphor::Pencil->thin(),
            self::Viewer  => Phosphor::Eye->thin(),
            self::Creator => Phosphor::Plus->thin(),
        };
    }

    public function getLabel(): string {
        return match($this) {
            self::Manager => 'Manager',
            self::Editor  => 'Editor',
            self::Viewer  => 'Viewer',
            self::Creator => 'Creator',
        };
    }
}
```

Passing a Backend Enum automatically maps the enum cases to the component options, descriptions, icons, and extra texts.

```
RadioList::make('role')
    ->label('Role')
    ->enum(Roles::cases())

    //  No need to specify these if enum is using filament enum contracts
    // ->descriptions()
    // ->icons()
    // ->extraTexts()
,
```

You can hide the descriptions, icons, and extra texts if you don't need them.

```
RadioList::make('role')
    ->enum(Roles::class)
    ->hiddenDescriptions()
    ->hiddenIcons()
    ->hiddenExtraTexts()
,

// Accepts Closures
RadioList::make('role')
    ->enum(Roles::class)
    ->hiddenDescription(fn () => false)
    ->hiddenIcon(fn () => false)
    ->hiddenExtraText(fn () => false)
,
```

### Advanced Features

[](#advanced-features-1)

#### Search and Bulk Operations

[](#search-and-bulk-operations)

```
CheckboxList::make('permissions')
    ->label('Permissions')
    ->enum(Permissions::class)
    ->searchable()
    ->searchPrompt('Search permissions...')
    ->bulkToggleable()
,
```

[![Radio List Demo](https://raw.githubusercontent.com/tonegabes/filament-better-options/refs/heads/main/images/checkbox_list_search_bulk.jpg)](https://raw.githubusercontent.com/tonegabes/filament-better-options/refs/heads/main/images/checkbox_list_search_bulk.jpg)

#### Custom Positioning and Visibility

[](#custom-positioning-and-visibility)

```
RadioCards::make('role')
    ->label('Role')
    ->columns(2)
    ->enum(Roles::class)
    ->partiallyHiddenIndicator()
    ->itemsCenter()
    ->iconAfter()
    ->indicatorBefore()

    // ->hiddenIndicator() // You also can totaly hide the indicator
,
```

[![Radio Cards Demo](https://raw.githubusercontent.com/tonegabes/filament-better-options/refs/heads/main/images/radio_cards_positioning.jpg)](https://raw.githubusercontent.com/tonegabes/filament-better-options/refs/heads/main/images/radio_cards_positioning.jpg)

#### Icons and Indicators

[](#icons-and-indicators)

```
RadioList::make('role')
    ->label('Role')
    ->enum(Roles::class)
    ->idleIndicator(Phosphor::User->thin())
    ->selectedIndicator(Phosphor::User->fill())
,
```

[![Radio List Indicators Demo](https://raw.githubusercontent.com/tonegabes/filament-better-options/refs/heads/main/images/radio_list_indicators.jpg)](https://raw.githubusercontent.com/tonegabes/filament-better-options/refs/heads/main/images/radio_list_indicators.jpg)

#### Extra Texts/Values

[](#extra-textsvalues)

```
CheckboxCards::make('permissions')
    ->label('Permissions')
    ->columns(2)
    ->enum(Permissions::class)
    ->extraTexts([
        'view'   => 'model.view',
        'edit'   => 'model.edit',
        'delete' => 'model.delete',
        'create' => 'model.create',
    ])
,
```

[![Checkbox Cards Extratexts Demo](https://raw.githubusercontent.com/tonegabes/filament-better-options/refs/heads/main/images/checkbox_cards_extratexts.jpg)](https://raw.githubusercontent.com/tonegabes/filament-better-options/refs/heads/main/images/checkbox_cards_extratexts.jpg)

```
RadioCard::make('storage')
    ->enum(Storages::class)
    ->hiddenIcon()
    ->partiallyHiddenIndicator()
    ->idleIndicator(Phosphor::HardDrives->thin())
    ->selectedIndicator(Phosphor::HardDrives->fill())
```

### Pre-defined Themes

[](#pre-defined-themes)

```
// Modern Theme - Icons before, indicators after, centered
CheckboxCards::make('options')
    ->options($options)
    ->theme('modern');

// Minimal Theme - Subtle indicators
CheckboxCards::make('options')
    ->options($options)
    ->theme('minimal');

// Classic Theme - Traditional layout
CheckboxCards::make('options')
    ->options($options)
    ->theme('classic');
```

Available Components
--------------------

[](#available-components)

ComponentDescriptionFeatures`CheckboxList`Vertical list of checkboxesSearch, Bulk toggle, Icons`CheckboxCards`Grid of checkbox cardsAll list features + Columns, Centering`RadioList`Vertical list of radio buttonsIcons, Custom indicators`RadioCards`Grid of radio button cardsAll list features + Columns, CenteringComponent Methods
-----------------

[](#component-methods)

### Common Methods (All Components)

[](#common-methods-all-components)

```
// Content
->options(array $options)
->descriptions(array $descriptions)
->extraTexts(array $extraTexts)
->hiddenDescription(bool|Closure $condition = true)
->hiddenExtraText(bool|Closure $condition = true)

// Icons and Indicators
->icons(array $icons)
->iconBefore()
->iconAfter()
->hiddenIcon(bool|Closure $condition = true)
->idleIndicator(string $icon)
->selectedIndicator(string $icon)
->indicatorBefore()
->indicatorAfter()
->hiddenIndicator(bool|Closure $condition = true)
->partiallyHiddenIndicator(bool|Closure $condition = true)
```

### Checkbox-Specific Methods

[](#checkbox-specific-methods)

```
// Search functionality
->searchable(bool $condition = true)
->searchPrompt(string $prompt)

// Bulk operations
->bulkToggleable(bool $condition = true)
->selectAllAction(Action $action)
->deselectAllAction(Action $action)
```

### Card-Specific Methods

[](#card-specific-methods)

```
// Layout
->columns(int|array $columns)
->itemsCenter(bool|Closure $condition = true)
```

Styling and Themes
------------------

[](#styling-and-themes)

The package uses Tailwind CSS classes and supports Filament's theming system. Main CSS classes:

```
/* Component containers */
.fi-fo-checkbox-list
.fi-fo-checkbox-card
.fi-fo-radio-list

/* Individual options */
.fi-fo-checkbox-option
.fi-fo-radio-item

/* Content elements */
.fi-fo-checkbox-option__label
.fi-fo-checkbox-option__description
.fi-fo-checkbox-option__extra
.fi-fo-checkbox-option__icon
.fi-fo-checkbox-option__indicator

/* State classes */
.is-selected
.is-centered
.is-indicator-partially-hidden
.is-indicator-partially-hidden
```

Credits
-------

[](#credits)

- [Tone Gabes](https://github.com/tonegabes)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

---

 **Made with ❤️ by [Tone Gabes](https://tonegabes.com)**

###  Health Score

51

—

FairBetter than 96% of packages

Maintenance87

Actively maintained with recent releases

Popularity35

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 92% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~12 days

Total

17

Last Release

52d ago

Major Versions

0.1.0 → 1.0.02025-09-10

PHP version history (2 changes)0.1.0PHP ^8.3

1.3.0PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/e3601e3761366d2e66ee37b091360e1c9bfc1d1dc764ff0f940434c9c75a36fc?d=identicon)[tonegabes](/maintainers/tonegabes)

---

Top Contributors

[![tonegabes](https://avatars.githubusercontent.com/u/13951423?v=4)](https://github.com/tonegabes "tonegabes (23 commits)")[![aligulzar729](https://avatars.githubusercontent.com/u/32263497?v=4)](https://github.com/aligulzar729 "aligulzar729 (2 commits)")

---

Tags

phppluginlaravelFormscheckboxfilamenttonegabes

###  Code Quality

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/tonegabes-filament-better-options/health.svg)

```
[![Health](https://phpackages.com/badges/tonegabes-filament-better-options/health.svg)](https://phpackages.com/packages/tonegabes-filament-better-options)
```

###  Alternatives

[awcodes/filament-table-repeater

A modified version of the Filament Forms Repeater to display it as a table.

262815.1k5](/packages/awcodes-filament-table-repeater)[codewithdennis/filament-select-tree

The multi-level select field enables you to make single selections from a predefined list of options that are organized into multiple levels or depths.

320392.1k17](/packages/codewithdennis-filament-select-tree)[pboivin/filament-peek

Full-screen page preview modal for Filament

253319.6k12](/packages/pboivin-filament-peek)[awcodes/filament-badgeable-column

Filament Tables column to append and prepend badges.

142419.3k3](/packages/awcodes-filament-badgeable-column)[defstudio/filament-searchable-input

A searchable autocomplete input for Filament forms

3212.4k](/packages/defstudio-filament-searchable-input)[schmeits/filament-character-counter

This is a Filament character counter TextField and Textarea form field for Filament v4 and v5

33184.7k6](/packages/schmeits-filament-character-counter)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
