page DarkModeGuide { layout = "showcase" seo { title = "Dark mode" description = "Choose light, dark, or system mode. The selection persists and updates every preview." } view {
Customization

Dark mode

Choose light, dark, or system mode. The selection persists and updates every preview.

Choose a default

Set light, dark, or system in wrnexus.config.ts. System mode follows the operating-system preference until the user selects an explicit value.

Persist preference

Use PreferenceSwitcher or your own control to update the document theme. The selected value persists and is applied before interactive components hydrate.

Author with tokens

Use semantic --wire-* variables instead of hard-coded light colors. Tokens switch surfaces, text, borders, focus, and status colors together.

Test both modes

Check content, overlays, charts, disabled controls, focus rings, and browser autofill in both modes. Do not treat dark mode as a simple color inversion.

Quick start

theme: {
  default: "system",
  palette: "violet",
}
} }