Summary
Multi-select checklist with row layout, optional icons and descriptions, and animated checkbox indicators.| Class | Bjanczak\FilamentFlexFields\Filament\Forms\Components\FlexChecklist |
| State type | list<string|int> — selected option keys |
| FieldType | flex_checklist |
| Playground | flex-checklist slug in Flex Fields playground |
| State cast | OptionsArrayStateCast |
Basic usage
Standard checklist
Rich options with icons and descriptions
State & validation
Stored value
State is an array of unique string or integer keys.Validation rules (built-in)
| Rule | Description |
|---|---|
array | Always enforced. |
| Option keys | Selected 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 acceptClosure unless noted.
| Method | Type | Default | Description |
|---|---|---|---|
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) | Validation | null | Minimum required selections. |
maxSelections(int|Closure $n) | Validation | null | Maximum allowed selections. |
exactSelections(int|Closure $n) | Validation | null | Requires exactly n selections. |
Public helper methods
| Method | Returns | Description |
|---|---|---|
getLockIcon() | mixed | Resolved icon for disabled rows. |
getNormalizedOptions() | array | Merged metadata for all options. |
getWrapperClasses() | array | List of CSS classes for the root element. |
Real-world examples
Project file manager
Playground
/admin/flex-fields-playground/flex-checklist
See Playground for setup.
Related components
| Component | When to use instead |
|---|---|
| FlexRadiolist | For single-select lists with the same row layout. |
| ChoiceCheckboxCards | For larger, more prominent multi-select cards. |
| ItemCardGroup | For grouping rows that aren’t form inputs. |
CSS classes (reference)
| Class | Role |
|---|---|
fff-flex-checklist | Root wrapper |
fff-flex-checklist--{sm|md|lg} | Size modifier |
fff-flex-checklist__row | Individual option row |
fff-flex-checklist__row--selected | Active row state |
fff-flex-checklist__row--disabled | Disabled/locked state |
fff-flex-checklist__indicator | Checkbox container |
fff-flex-checklist__content | Text and icon container |