Skip to main content
← Back to Table of Contents

Summary

Premium image choice cards — full-bleed image, footer with label and selection indicator, two layout variants. One component covers radio exclusive (multiple(false)) and checkbox multi (multiple(true) with min/max/exact).

Layout variants

Both variants support radio and checkbox modes, size, rounding, gridColumns, imageAspectRatio, imageFit, disabledOptions, and dark mode. Invalid variant() values fall back to default.

Basic usage

Radio exclusive (default layout)

Selecting another card replaces the previous value (native radio + Alpine select).

Overlay layout

Use imageAspectRatio() to control card height in overlay mode (ratio applies to the whole card, not only the media block).

Checkbox multi with limits

When maxSelections is reached, further options cannot be selected until one is cleared. Works with either layout variant.

State & validation

Stored value

Validation rules (built-in)

Translation keys: filament-flex-fields::default.validation.image_choice_cards.{min,max,exact,invalid_option}.

Reactive disabled options

The sibling Select must be ->live() so the Closure re-runs. Image Choice Cards has no wire:ignore on the root, so Livewire morph refreshes the disabled map. If the current selection becomes disabled, state is cleared (single → null, multi → filtered array) on the server and in Alpine.

Options shape

Empty / missing image shows a muted placeholder block. String shorthand is supported: 'athletic' => 'Athletic' normalizes to ['label' => 'Athletic'].

Fluent API

All methods accept Closure unless noted.

FlexFieldFormBuilder / Studio config

Defaults: see FieldTypeDefaultConfigRegistry for image_choice_cards.

Playground

/admin/flex-fields/image-choice-cards Demos: square 1:1, overlay layout, radio exclusive, checkbox min/max, size/rounding/aspect matrix, Select → reactive disabledOptions, required validation, dark mode via panel.

CSS / JS

CSS classes (reference)

Visual behavior

  • Hover: subtle image zoom (scale(1.04)) inside clipped media.
  • Reload: selected state is server-rendered (is-selected, checked) before Alpine loads to avoid flash.
  • Overlay scrim: ::after on .fff-image-choice-cards__item — z-index between image and footer.

See also

Keyboard, direction and safe values

Use Tab to reach the control, Space or Enter to select, and arrow keys or Home / End to navigate enabled options. In a single-selection group, arrow navigation also changes the value. Multiple-selection groups move focus without changing selections. Horizontal navigation follows the text direction. Direction is inherited from the page, or can be set on this field:
Validation checks the submitted values on the server. Unknown or disabled option keys, nested values, duplicate selections and associative selection arrays are rejected. Numeric identifiers travel as strings to preserve leading zeros and large IDs; an Eloquent integer cast can still store an integer column. exactSelections() takes precedence over minimum and maximum settings. The selection cap also blocks additional choices immediately; selected choices can always be removed. Negative limits and a minimum above the maximum are invalid configuration. If a stored selection is now disabled, resolve it before saving; Image Choice Cards can clear disabled choices with pruneDisabledSelection().
Last modified on October 16, 2026