Theme Toggle
llms.txtExample
Usage
<ThemeToggle />
If this component is used anywhere on your site, the mode will default to system settings (if the user has not manually set the mode).
Accessibility
- If javascript is disabled, the theme toggle will not be shown.
API Reference
ThemeToggle
A button that toggles between light, dark, and system theme modes. Uses mode-watcher under the hood.
Property Type Description
defaultMode
enum
The initial theme mode. Default:
'system'class
string
Additional CSS classes to apply. Default: —
ref $bindable
HTMLElement
The underlying DOM element. Default: —
Property
defaultMode
class
ref