Switch

An on/off toggle with the same API as Checkbox, announced as a switch.

Source on GitHub

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
Code

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).

PropertyAttributeTypeDefaultDescription
checkedchecked (initial)booleanCurrent state. The checked attribute is the initial state.
valuevaluestringonSubmitted value when on.
namenamestringForm field name.
labellabelstringLabel text (or the content).
descriptiondescriptionstringHelp text.
errorerrorstringError text.
labelPositionlabel-position reflectsend | start | right | leftendSide of the label: start/end follow the writing direction; left/right are sides of the screen.
colorcolorstringTrack color when on.
sizesize reflectsxs | sm | md | lg | xlsmTrack size.
disableddisabledbooleanNot interactive nor submitted.
EventDescription
changeWhen the user toggles it.
SlotDescription
(default)Label content.
PartDescription
trackThe track.
thumbThe thumb.