Switches
Use when the change applies immediately. For form submissions, prefer a checkbox.
Examples
Section titled “Examples”Default
Section titled “Default”<input type="checkbox" role="switch" class="switch" /><input type="checkbox" role="switch" class="switch" checked /><Switch /><Switch defaultChecked />Disabled
Section titled “Disabled”<input type="checkbox" role="switch" class="switch" disabled /><input type="checkbox" role="switch" class="switch" disabled checked /><Switch disabled /><Switch disabled defaultChecked />Inside a Field
Section titled “Inside a Field”.field-row lays the switch and label out on one line; the default .field stacks vertically.
<div class="field field-row"> <input type="checkbox" role="switch" class="switch" checked /> <label class="field-label">Email notifications</label></div><Field name="notify" className="field-row"> <Switch defaultChecked /> <Field.Label>Email notifications</Field.Label></Field>