Summary
SaaS-style multi-select checklist. Same row layout as FlexRadiolist but stores an array of selected keys.| Class | Bjanczak\FilamentFlexFields\Filament\Forms\Components\FlexChecklist |
| State type | list<string|int> — selected option keys |
| FieldType | flex_checklist |
| State cast | OptionsArrayStateCast |
Basic usage
State format
Array of unique string keys. Default:[]. Duplicate values are deduplicated on validation.
Validation
| Rule | Detail |
|---|---|
array | State must be an array |
| Option keys | Each value must exist in options() |
exactSelections(n) | Exactly n items selected |
minSelections(n) | At least n items |
maxSelections(n) | At most n items |
required() | Implies minSelections(1) when no explicit min |
Configuration API
options(array|Closure $options)
key => label or rich array (label, description, desc, icon, disabled). From HasChecklistOptions.
icons(array|Closure $icons)
Per-key icon map merged into options.
descriptions(array|Closure $descriptions)
Per-key description map. Config key desc also supported.
disabledOptions(array|Closure $keys)
Keys rendered locked with lock icon.
size(string|ControlSize|Closure $size)
sm, md (default), lg.
color(string|Closure|null $color)
Filament color for selected rows. Default: primary.
minSelections(int|Closure|null $count)
Minimum selections. null = no minimum (unless required()).
maxSelections(int|Closure|null $count)
Maximum selections.
exactSelections(int|Closure|null $count)
Exact count; overrides min/max semantics when set.
Public helper methods
| Method | Returns | Description |
|---|---|---|
getColor() | string|null | Accent color |
getLockIcon() | string|BackedEnum|Htmlable | Lock icon for disabled rows |
getMinSelections() | int|null | Min count |
getMaxSelections() | int|null | Max count |
getExactSelections() | int|null | Exact count |
getOptionKeys() | list | Valid keys |
getNormalizedOptions() | array | Merged option metadata |
getDisabledOptions() | array | Disabled keys |
isOptionDisabled(string|int $key) | bool | Row disabled |
getChecklistSizeStyles() | array | CSS custom properties |
getWrapperClasses() | list<string> | fff-flex-checklist |
FlexField schema config
| Config key | Maps to |
|---|---|
options | options() |
icons | icons() |
descriptions / desc | descriptions() |
disabled_options | disabledOptions() |
size | size() |
color | color() |
min_selections | minSelections() |
max_selections | maxSelections() |
exact_selections | exactSelections() |
CSS classes
| Class | Role |
|---|---|
fff-flex-checklist | Root wrapper |
fff-flex-checklist--{sm|md|lg} | Size modifier |
fff-flex-checklist__row | Option row |
fff-flex-checklist__indicator | Checkbox indicator |
Implementation notes
- Pair with
live()+afterStateUpdated()for autosave patterns (same as FlexRadiolist). - Locked options show
getLockIcon()and cannot be toggled.