Toggle Switch

On/off toggle with optional labels, state text, and keyboard accessibility.

Basic Toggle

Pre-checked

With On/Off Labels

Disabled

Toggle a switch to see output...
PHP

PHP PHP Methods (Fluent)

Method / PropertyParametersDescription
$m->toggleSwitch($id)stringCreate a toggle switch component.
->name($name)stringForm field name.
->value($value)stringHidden input value when checked.
->checked($checked)boolSet checked state (default: true).
->disabled($disabled)boolDisable the toggle.
->label($label)stringLabel text shown beside the switch.
->onLabel($text)stringText shown when switch is ON.
->offLabel($text)stringText shown when switch is OFF.