Components
← All components

Theme Toggle

stimeo--theme

Remembers a light, dark or match-my-device choice and applies it to the whole page.

  • Core

Remembers which colour scheme was chosen and brings it back on the next visit. There are three choices: light, dark, and matching the device. While matching the device, a change in the operating system's setting is followed immediately. The resolved scheme is written on the root of the page, so the colours themselves stay in your CSS: this part ships none. With three choices it is built as a group of options, so the arrow keys select and screen readers hear it correctly. For light and dark alone, a single button holding a pressed state works too.

running

Preview

This box is themed locally — the page itself is left untouched.

Keyboard

KeyAction
→ / ↓ Moves to and selects the next theme option (radiogroup). Under RTL only the horizontal pair swaps.
← / ↑ Moves to and selects the previous theme option. Under RTL only the horizontal pair swaps.
Home / End Selects the first / last theme option.
Enter / Space Activates the focused option (or toggles the single button).