Skip to main content
← Back to Table of Contents

Summary

Multi-select checklist with row layout, optional icons and descriptions, and animated checkbox indicators.
ClassBjanczak\FilamentFlexFields\Filament\Forms\Components\FlexChecklist
State typelist<string|int> — selected option keys
FieldTypeflex_checklist
Playgroundflex-checklist slug in Flex Fields playground
State castOptionsArrayStateCast

Basic usage

Standard checklist

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

FlexChecklist::make('features')
    ->label('Included features')
    ->options([
        'wifi' => 'Wi‑Fi',
        'parking' => 'Parking',
        'breakfast' => 'Breakfast',
    ]);

Rich options with icons and descriptions

FlexChecklist::make('permissions')
    ->options([
        'read' => [
            'label' => 'Read',
            'description' => 'Can view records',
            'icon' => 'heroicon-o-eye',
        ],
        'write' => [
            'label' => 'Write',
            'description' => 'Can edit records',
            'icon' => 'heroicon-o-pencil',
        ],
    ])
    ->color('success');

State & validation

Stored value

State is an array of unique string or integer keys.
$record->features; // ['wifi', 'breakfast']

Validation rules (built-in)

RuleDescription
arrayAlways enforced.
Option keysSelected keys must exist in options().
minSelections(n)Minimum items (default 1 if required()).
maxSelections(n)Maximum items allowed.
exactSelections(n)Requires exactly n items.

Configuration API

All methods accept Closure unless noted.
MethodTypeDefaultDescription
options(array|Closure $options)Setup[]Option map: key => label or rich array (label, description, icon, disabled).
icons(array|Closure $icons)Setup[]Per-key icon map (overrides options).
descriptions(array|Closure $desc)Setup[]Per-key description map (overrides options).
disabledOptions(array|Closure $keys)Setup[]Keys rendered locked with a lock icon.
color(string|Closure|null $color)Setup'primary'Accent color for selected rows.
size(string|Closure $size)Setup'md'Row scale: sm, md, lg.
minSelections(int|Closure $n)ValidationnullMinimum required selections.
maxSelections(int|Closure $n)ValidationnullMaximum allowed selections.
exactSelections(int|Closure $n)ValidationnullRequires exactly n selections.

Public helper methods

MethodReturnsDescription
getLockIcon()mixedResolved icon for disabled rows.
getNormalizedOptions()arrayMerged metadata for all options.
getWrapperClasses()arrayList of CSS classes for the root element.

Real-world examples

Project file manager

FlexChecklist::make('files')
    ->label('Project files')
    ->options([
        'budget' => 'Budget.xlsx',
        'reports' => 'Reports.pdf',
        'archive' => 'Archive.zip',
    ])
    ->icons([
        'budget' => 'heroicon-o-table-cells',
        'reports' => 'heroicon-o-document-text',
        'archive' => 'heroicon-o-archive-box',
    ])
    ->disabledOptions(['archive']);

Playground

/admin/flex-fields-playground/flex-checklist See Playground for setup.
ComponentWhen to use instead
FlexRadiolistFor single-select lists with the same row layout.
ChoiceCheckboxCardsFor larger, more prominent multi-select cards.
ItemCardGroupFor grouping rows that aren’t form inputs.

CSS classes (reference)

ClassRole
fff-flex-checklistRoot wrapper
fff-flex-checklist--{sm|md|lg}Size modifier
fff-flex-checklist__rowIndividual option row
fff-flex-checklist__row--selectedActive row state
fff-flex-checklist__row--disabledDisabled/locked state
fff-flex-checklist__indicatorCheckbox container
fff-flex-checklist__contentText and icon container