Summary
SaaS-style boolean toggle: label and description on one side, switch on the other.| Class | Bjanczak\FilamentFlexFields\Filament\Forms\Components\SwitchField |
| State type | bool |
| Model cast | 'is_admin' => 'boolean' |
| FieldType | toggle |
Basic usage
Validation
| Method | Laravel rule |
|---|---|
| (default) | boolean |
accepted() | accepted — must be true |
declined() | declined — must be false |
Toggle / Checkbox validation.
Configuration API
inline(bool|Closure $condition = true)
Renders the toggle switch inline alongside other elements rather than in its own block layout.
inlineWithLabel(bool|Closure $condition = true)
Positions the toggle switch inline on the same row, immediately next to the label.
Implementation notes
hiddenLabel()is called insetUp()so the label renders inside the component, avoiding duplicate labels in field groups.- Default state:
false.
FlexField schema config
| Config key | Maps to |
|---|---|
variant | variant() |
layout | layout() |
size | size() |
color | color() |
badge | badge() |
badge_color | badgeColor() |
description | description() |
on_color | onColor() |
off_color | offColor() |
on_icon | onIcon() |
off_icon | offIcon() |
label_position | labelPosition() |
ripple | ripple() |
compact | compact() |