Skip to content

ThemeToggle

Light / dark switcher — persists to localStorage, syncs across tabs, no FOUC.

Installation

Included in the starter. Every new site has it in src/components/ui/theme-toggle/. Import it where you need it, or register it in src/components.ts to use it on every page. If your site predates it, install it:

npx @cloudflare/nimbus-docs add theme-toggle

Preview

Click to flip between light and dark. Persists across navigation.

<ThemeToggle />

Type to search…

↑↓ navigate↵ selectEsc close