Switch
Switch is used to represent switching between two states (e.x on-off)
Examples
Basic
Basic switch usage
Disabled
Disable state of switch
Using Slots
How to use slots to set values for checked/unchecked state
Switch size
Switches can be either the default
size or small
Loading
Loading state of the switch
API
Attributes
Property | Description | Type | Default |
---|---|---|---|
autoFocus | Get focus when component mounted. | Boolean | false |
checked | Determine whether the Switch is checked. This property can be used for 2 way binding. | Boolean | false |
disabled | Disables the Switch | Boolean | false |
loading | Shows loading for the Switch | Boolean | false |
size | The size of the Switch, options: `default` `small` | String | default |
Events
Name | Description |
---|---|
change | Triggers when the switch value changes. |
click | Triggers when the switch is clicked. |
Bind
Name | Description |
---|---|
focus | Let's you bind to the button focus method. |
blur | Let's you bind to the button blur method. |
Slots
Name | Description |
---|---|
checked | Used to define what to show when the switch is checked. |
unchecked | Used to define what to show when the switch is unchecked. |