Skip to content

Toggle

The toggle captures a single boolean with a switch-style control. Use it for settings where the on or off state is the important thing. Create one with Toggle::make().

Toggle::make('published', 'Published')
->helperText('Show this item publicly.')

Use a Checkbox when the label is consent or agreement text. Use a toggle when the field enables or disables a setting.

Toggle shares label, default value, required, disabled, read-only, and visibility options with every field — see Fields. For validation and conditional behavior, see Validation and Conditional fields.