Theme toggle

Icon button that cycles the document theme: system, light, dark.

Source on GitHub

Code

API

For AI agents: this API as Markdown, or every component in llms-full.txt.

<ray-theme-toggle> · RayThemeToggle

PropertyAttributeTypeDefaultDescription
sizesize reflectsxs | sm | md | lg | xlsmControl height.
EventDescription
ray-theme-changeFired on the document root by setTheme(); detail: { theme, resolved, primary }.
PartDescription
buttonThe inner button.

Texts

What it writes itself, in English; setStrings() translates them (Getting started: Languages).

KeyEnglish
theme-toggle.systemSystem theme
theme-toggle.lightLight theme
theme-toggle.darkDark theme
theme-toggle.switch{theme} (switch to {next})
theme-toggle.to-systemsystem
theme-toggle.to-lightlight
theme-toggle.to-darkdark