Switch
Requires:
@ray-js/ray≥0.5.10
Description
Switch selector for toggling between two mutually exclusive states.
Props
| Property | Type | Required | Default | Description |
|---|---|---|---|---|
checked | boolean | No | - | Whether currently checked |
disabled | boolean | No | false | Whether disabled |
color | string | No | #007AFF | Switch color, same as CSS color |
type | "switch" | "checkbox" | No | switch | Style type; options: switch, checkbox |
name | string | No | - | Form field name, used as the key on form submit |
| No | - | Fires when the checked state changes; detail contains value |
Valid Values
type
| Value | Description | Since |
|---|---|---|
switch | Switch style | - |
checkbox | Checkbox style | - |