An on/off switch control for binary settings. — <cs-toggle>
<cs-toggle>Dark mode</cs-toggle>
<cs-toggle checked>Notifications</cs-toggle>
<cs-toggle description="Enable email alerts.">Email alerts</cs-toggle>
aria-controlsstringAdds aria-controls attribute to the component.
If the component controls any secondary content (for example, another form field), use this to provide an ID referring to the secondary content.
aria-labelstring
default: nullAdds an aria-label to the native control.
Use this if you don't have a visible label for this control.
checkedbooleanrequiredSpecifies if the component is selected.
control-idstringSpecifies the ID of the native form element. By default, it uses an automatically generated ID.
disabledbooleanSpecifies if the control is disabled, which prevents the user from modifying the value and prevents the value from being included in a form submission. A disabled control can't receive focus.
namestringSpecifies the name of the control used in HTML forms.
read-onlyboolean
default: falseSpecifies if the control is read-only, which prevents the
user from modifying the value. Should be used only inside forms.
A read-only control is still focusable.
If both readOnly and disabled are set, disabled takes precedence.
defaultThe control's label that's displayed next to the toggle. Clicking this will invoke a state change.
descriptionDescription that appears below the label.
blurCustomEvent<void>Called when input focus is removed from the UI control.
changeCustomEvent<ToggleProps.ChangeDetail>focusCustomEvent<void>Called when input focus is moved to the UI control.