Switch

Usage

<Switch />

Disable

<Switch disabled />

Icons

<Switch icons="selected" />
<Switch icons="both" />

API

Switch

Attributes

AttributeTypeDescription
disabledbooleanDisables the switch.
icons'checked' | 'both' | undefinedControls the visibility of icons. Determines if only one icon is shown when checked, if both both are shown (which also increases the size of the indicator when unchecked) or none for never showing an icon.

Bindables

AttributeTypeDescription
selectedbooleanThe state of the switch. True indicates the switch is on.
elementHTMLDivElementA reference to the root DOM element of the component. This variable is bound using bind:this, allowing direct access to the underlying HTML element for manipulation or querying within the component's logic.
inputElementHTMLInputElement | undefinedAllows access to the underlying native checkbox input element.