Switch
An on/off toggle with the same API as Checkbox, announced as a switch.
A settings panel
NotificationsPause all of them at once.
EmailMentions, replies and invitations.
PushOn this device, while the app is closed.
Weekly digestEvery Monday at 9:00.
On: Email, Push.
Labels, descriptions and sides
Colors and sizes
API
For AI agents: this API as Markdown, or every component in llms-full.txt.
<ray-switch> · RaySwitch
Same properties and events as ray-checkbox (indeterminate does not apply).
| Property | Attribute | Type | Default | Description |
|---|---|---|---|---|
checked | checked (initial) | boolean | Current state. The checked attribute is the initial state. | |
value | value | string | on | Submitted value when on. |
name | name | string | Form field name. | |
label | label | string | Label text (or the content). | |
description | description | string | Help text. | |
error | error | string | Error text. | |
labelPosition | label-position reflects | end | start | right | left | end | Side of the label: start/end follow the writing direction; left/right are sides of the screen. |
color | color | string | Track color when on. | |
size | size reflects | xs | sm | md | lg | xl | sm | Track size. |
disabled | disabled | boolean | Not interactive nor submitted. |
| Event | Description |
|---|---|
change | When the user toggles it. |
| Slot | Description |
|---|---|
| (default) | Label content. |
| Part | Description |
|---|---|
track | The track. |
thumb | The thumb. |