bangnokia / filament-radio-card
The radio group with card format for Filament
Installs: 9
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Language:Blade
Requires
- php: ^8.1|^8.2|^8.3
- filament/forms: ^3.0
- filament/tables: ^3.0
- illuminate/contracts: ^10.0
README
This is a custom input for Filament form, instead of boring Radio buttons, you can display them with icons. The idea come from my product ping2.me for selecting the chat provider.
Installation
composer require bangnokia/filament-radio-card
Usage
Example you have an enum class like, which implemented HasIcon
trait from Filament
use Filament\Support\Contracts\HasColor; use Filament\Support\Contracts\HasIcon; use Filament\Support\Contracts\HasLabel; enum BotProvider: string implements HasLabel, HasIcon { case Telegram = 'telegram'; case Discord = 'discord'; case Slack = 'slack'; public function getLabel(): ?string { return $this->name; } public function getIcon(): ?string { return match ($this) { self::Telegram => 'icon-telegram', self::Discord => 'icon-discord', self::Slack => 'icon-slack', }; } }
Then you can use it in your form like this
RadioCard::make('provider') ->options(BotProvider::class) ->default(BotProvider::Telegram) ->columns(count(BotProvider::cases()))