Theme switcher
Four smooth ways to move between light and dark appearance.
The next appearance opens from a slim center seam.
npx shadcn@latest add @silicon-ui/theme-switch-splitnpx shadcn@latest add @silicon-ui/theme-switch-splitInstall the dependencies.
npm install lucide-react motionCopy these files into your project. Shared files are skipped if you already have them.
components/silicon-ui/theme-switch/theme-switch.tsxcomponents/silicon-ui/theme-switch/theme-switch.module.csscomponents/silicon-ui/button/button.tsx sharedcomponents/silicon-ui/button/button.module.css sharedInstall the foundation once per app for the design and motion tokens: npx shadcn@latest add @silicon-ui/silicon-foundation
| Prop | Type | Default |
|---|---|---|
theme* | Theme
| — |
onThemeChange* | (next: Theme, variant: ThemeSwitchVariant, trigger: HTMLElement) => void | — |
variant | ThemeSwitchVariant
| "reveal" |
label | string | — |
iconOnly | boolean | false |