Summary
A modern replacement for Filament’s native Radio component.FlexRadiolist adds support for per-option icons, rich descriptions, and custom sizing via CSS variables. It also features a “label-only” variant for compact layouts.
| Class | Bjanczak\FilamentFlexFields\Filament\Forms\Components\FlexRadiolist |
| State type | string|int|null |
| Model cast | 'plan_type' => 'string' · 'category_id' => 'integer' |
| FieldType | radiolist |
| Playground | flex-radiolist slug in Flex Fields playground |
| Default variant | default |
Basic usage
Standard list with descriptions
List with icons and colors
State & validation
Stored value
State is the option key fromoptions().
Validation
The field automatically validates that the selected value exists in the configured options.Variants
Default
Shows labels, descriptions (if set), and icons (if set) in a vertical list of cards.Label-only
A more compact version that hides icons and descriptions, focusing only on the labels.Configuration API
All methods acceptClosure unless noted.
| Method | Type | Default | Description |
|---|---|---|---|
options(array|Closure $options) | Setup | [] | Key => Label mapping |
icons(array|Closure $icons) | Setup | [] | Key => Icon string |
descriptions(array|Closure $desc) | Setup | [] | Key => Description string |
disabledOptions(array|Closure $keys) | Setup | [] | Keys to disable |
color(string|Closure|null $color) | Setup | 'primary' | Active option color |
variant(string|Closure $variant) | Setup | 'default' | default or label-only |
size(string|Closure $size) | Setup | 'md' | sm, md, lg |
Real-world examples
Plan Selection Card
Playground
/admin/flex-fields-playground/flex-radiolist
See Playground for setup.
Related components
| Component | When to use instead |
|---|---|
| FlexChecklist | Multiple selection instead of single |
| ChoiceCards | Large visual cards with images |
| SegmentControl | Horizontal sliding selection |
CSS classes (reference)
| Class | Role |
|---|---|
fff-flex-radiolist | Root wrapper |
fff-flex-radiolist--{sm|md|lg} | Size variant |
fff-flex-radiolist--{variant} | Variant class |
fff-flex-radiolist__item | Individual option card |
fff-flex-radiolist__label | Option label |
fff-flex-radiolist__description | Option description |
fff-flex-radiolist__icon | Option icon wrapper |
fff-flex-radiolist__indicator | Radio dot indicator |