GitHub Issue #128

Three independent concepts

  • Brand/Visual Theme — nexwell-default (Landing-aligned, navy/orange) or nexwell-navy (dark navy app shell, compatible light content surfaces).
  • Appearance — light, dark, or system. Never conflated with brand.
  • User Preference / persistence — not owned by the Design System. ThemeProvider is controlled-or-uncontrolled; the consuming app decides whether/how to persist a choice.

Live — runtime switching, no reload

Try it

Resolved: nexwell-default / light → light

Required preview matrix

NexWell Default / NexWell Navy × Light / Dark

nexwell-default / light

Period TrackerNotifications

nexwell-default / dark

Period TrackerNotifications

nexwell-navy / light

Period TrackerNotifications

nexwell-navy / dark

Period TrackerNotifications

API

ThemeProvider / useTheme

import { ThemeProvider, useTheme, getThemeInitScript } from "@nexwell/theme";

// App root (Next.js layout) — no-flash via an inline init script:
<script dangerouslySetInnerHTML={{ __html: getThemeInitScript({
  defaultBrand: "nexwell-default",
  defaultAppearance: "system",
  brandStorageKey: "nexwell-brand",       // optional — you own persistence
  appearanceStorageKey: "nexwell-appearance",
}) }} />
<ThemeProvider defaultBrand="nexwell-default" defaultAppearance="system">
  <App />
</ThemeProvider>

// Anywhere inside:
const { brand, appearance, resolvedAppearance, setBrand, setAppearance } = useTheme();