Switch API
API reference docs for the Stash Switch
component. Learn about the props, CSS, and other APIs of this exported module.
Import
ts
import Switch from '@leaflink/stash/Switch.vue';
Props
Name | Type | Default | Description |
---|---|---|---|
checked | boolean | Array | false | The current checked value, can be a boolean or an array of values |
disabled | boolean | false | Prevent the user from changing the switch state. |
hintText | string | '' | Displays text below the input; hidden when the isReadOnly prop is truthy. |
id | string | undefined | Unique ID for the switch, required for accessibility purposes |
label | string | '' | Label text to display with switch |
name | string | '' | HTML name property |
value | string | number |
| Value associated with switch when it is `checked`. This value is used to compare against `checked` property when passed as an array. |
Slots
Name | Description |
---|---|
hint | for displaying hint text |
Events
Name | Description |
---|---|
update:checked |