Wrap the app in the next-themes ThemeProvider, then place the control.
theme-choice.tsx
ThemeSwitch
| Prop | Type | Default | Description |
|---|---|---|---|
| control | "segmented""switch""toggle" | "toggle" | toggle: one icon button (Base UI Toggle). switch: a track and a thumb (Base UI Switch). segmented: light, dark, and system (Base UI Toggle Group). |
| transition | "blinds""blur""circle""diagonal""fade""none""wipe" | "circle" | The page change. Default circle, from the click point. |
| size | "default""lg""sm" | "default" | Toggle 28/32/36, switch 36/44/52 wide, segmented items 24/28/32. |
| variant | "default""outline" | "default" | The toggle look: no rest fill, or the field surface with an edge. |
| show | boolean | false | Segmented only: the item names show next to the icons. |
| value | "dark""light""system" | — | The theme, for a controlled control or another theme store. Default: next-themes theme. |
| on | — | Called with the new theme inside the page change. Without value, next-themes gets it too. Update the page synchronously here (React state, a store with no async middleware): the page change takes its picture of the new page when this call returns. | |
| disabled | boolean | — | |
| labels | — | Screen reader names, and the segmented labels. | |
| class | string | — | |
| id | string | — | |
| Space | Changes the theme, or picks the focused theme (segmented). |
|---|---|
| Enter | Changes the theme, or picks the focused theme (segmented). |
| Arrow keys | Move the focus between light, dark, and system (segmented). |
Built with
Installs with Theme Switch





