ThemeSwitcher

App

Tri-state theme selector (light / dark / system). Persists the choice to localStorage and toggles the .dark class on <html>. Mounts safely on the server with a placeholder until hydrated.

Closed trigger — system mode

Preview
Code
<%- include('modules/app/ThemeSwitcher') %>

Open menu — dark active

Preview
Code
<%- include('modules/app/ThemeSwitcher', {
  id: 'header-theme-switcher',
  className: 'shrink-0'
}) %>
Source modules/app/ThemeSwitcher.ejs