Skip to main content
← Back to Table of Contents

Summary

SaaS-style single-select list (radio behaviour). Same row layout as FlexChecklist but one choice at a time.
ClassBjanczak\FilamentFlexFields\Filament\Forms\Components\FlexRadiolist
State typestring|null — one option key
FieldTypeflex_radiolist

Basic usage

use Bjanczak\FilamentFlexFields\Filament\Forms\Components\FlexRadiolist;

FlexRadiolist::make('delivery')
    ->label('Delivery method')
    ->options([
        'standard' => 'Standard',
        'express' => [
            'label' => 'Express',
            'description' => '2–5 business days',
            'icon' => 'heroicon-o-bolt',
        ],
    ])
    ->default('express');
Label-only options (no icon, no description):
FlexRadiolist::make('role')
    ->options([
        'read' => 'Read',
        'write' => 'Write',
        'admin' => 'Admin',
    ]);

Validation

BehaviourDetail
Built-inRule::in(...) — value must be an option key
required()A selection is required

Configuration API

variant(string|Closure $variant)

Sets the visual layout variant. Available: default (standard list), cards (SaaS choice cards), label-only.
FlexRadiolist::make('gender')
    ->variant('cards');

Autosave on change

FlexRadiolist::make('delivery')
    ->options([...])
    ->live()
    ->afterStateUpdated(fn (string $state) => $this->saveDelivery($state));

FlexField schema config

Config keyMaps to
optionsoptions()
iconsicons()
descriptions / descdescriptions()
disabled_optionsdisabledOptions()
sizesize()
colorcolor()

Implementation notes

  • Row styles live in the shared flex-checklist.css bundle (.fff-flex-radiolist* classes). The radiolist blade loads that bundle via the flex-radiolistflex-checklist stylesheet alias — no separate CSS file.