One button that flips between light and dark mode, with a sweep across the page.
Import it and pass your content. The props that matter most are listed next.
"use client";
import { NotchsetThemeScript, ThemeSwitch } from "@/components/ui/notchset/theme-switch";
/** In your root layout's <head>: applies the saved (or system) theme before first paint. */
export function ThemeHead() {
return <NotchsetThemeScript />;
}
/**
* On its own the switch reads the page's theme, toggles the dark class on <html> and saves the choice,
* so a restored dark theme is never overwritten on mount. With next-themes, pass resolvedTheme and
* setTheme as theme and onThemeChange instead.
*/
export function ThemeToggle() {
return <ThemeSwitch />;
}theme / onThemeChange–
"light" | "dark" / (theme) => voidControlled, e.g. with next-themes' resolvedTheme and setTheme.
defaultTheme–
"light" | "dark"Uncontrolled start. Without either, it reads and toggles the dark class on <html> and saves the choice under localStorage "theme".
label–
stringThe key's label. Default "SWITCH THEME".
iconOnly–
booleanA 40×40 key.
sweep–
booleanThe View Transitions sweep. Default true; instant without support or under reduced motion.
labels–
{ toDark?, toLight? }The accessible names.
ThemeSwitchdata-slot="theme-switch"
The key (className and ref land here).
Platedata-slot="theme-switch-plated"
The key's plate.
components/ui/notchset/theme-switch.tsx
pnpm dlx shadcn@latest add https://notchset.dev/r/theme-switch.jsonpnpm dlx shadcn@latest add https://notchset.dev/r/radix-nova/theme-switch.jsonFree, no account or key. Use the command for your project's primitives: a radix-*, new-york or default style in components.json is Radix, a base-* style is Base UI. With the @notchset registry added, @notchset/<name> picks for you.
The CLI adds the styles to the CSS file named in components.json (tailwind.css). Check that it points at your global stylesheet, that the project uses Tailwind CSS v4, and that the file is imported in your root layout. Installed by hand: paste styles.css into that file.
Give your coding assistant the Markdown guide instead of screenshots.
https://notchset.dev/api/mcp (setup)v1.0.0 · 2026-10-02
First release