Choice Inputs
Four types let the user pick from a fixed set of options: Select, Radio, Checkbox, and EnumButtons. All four use the instant live() update mode — one click pushes the change to the preview immediately.
Select
A dropdown, compiled to a Filament Select. Pass an id => label map to options().
use FilamentCraft\Settings\Types\Select;
Select::make('layout')
->label('Layout')
->options([
'spotlight' => 'Spotlight',
'editorial' => 'Editorial',
'compact' => 'Compact',
])
->searchable()
->default('spotlight');| Method | Effect |
|---|---|
options(array $options) | value => label choices. |
searchable(bool $value = true) | Enable the search box (good for long lists). |
Radio
A radio-button group, compiled to a Filament Radio. Same options() shape as Select, but all choices are visible at once — best for two or three options.
use FilamentCraft\Settings\Types\Radio;
Radio::make('tone')
->label('Logo tone')
->options([
'mono' => 'Monochrome',
'color' => 'Full color',
])
->default('mono');| Method | Effect |
|---|---|
options(array $options) | value => label choices. |
Checkbox
A single boolean toggle, compiled to a Filament Checkbox. Its special power is cssValues(): map the on/off state directly to two CSS strings, so a boolean becomes a usable CSS value.
use FilamentCraft\Settings\Types\Checkbox;
Checkbox::make('button_uppercase')
->cssVar('--button-text-transform')
->cssValues('uppercase', 'none') // true -> uppercase, false -> none
->default(false);
// emits: --button-text-transform: none; (until toggled on)| Method | Effect |
|---|---|
cssValues(string $on, string $off) | The CSS string emitted for the checked / unchecked state. |
Without cssValues(), a checkbox stores a plain boolean you read in your Blade.
Enum buttons
A segmented button group, compiled to a Filament ToggleButtons rendered inline. Instead of an options() array it takes a string-backed enum class — each case becomes a button with its own label, color, and icon.
use FilamentCraft\Enums\Sections\SectionShape;
use FilamentCraft\Settings\Types\EnumButtons;
EnumButtons::make('shape')
->label('Shape')
->enum(SectionShape::class)
->default(SectionShape::Contained->value);| Method | Effect |
|---|---|
enum(string $enum) | FQCN of a string-backed enum. Required — the field throws without it. |
Enum requirements
The enum must be : string backed and implement Filament's HasLabel, HasColor, and HasIcon contracts so the buttons can render their label/color/icon. The built-in section enums (SectionShape, SectionDensity, SectionAlignment, MediaPlacement) all satisfy this — see Built-in Sections for their cases.
Because the value stored is the enum's backing string (e.g. 'contained'), always set the default with ->default(SectionShape::Contained->value), not the case instance.
