Skip to main content

Theme Toggle

A button that switches between light and dark themes.

Preview · Theme Toggle

Code​

<div class="hstack">
<button class="icon outline" title="Toggle theme" style="width:2.25rem;height:2.25rem">☀</button>
<span style="font-size:0.8rem;color:var(--muted-foreground)">Click to toggle light / dark mode</span>
</div>

Props​

PropTypeDefaultDescription
(toggled)EventEmitter<string>—Emits new theme
Version history

See the Changelog for version history and breaking changes.