Split
The next appearance opens from a slim center seam.
npx shadcn@latest add @silicon-ui/theme-switch-splitInstallation
With the shadcn CLI
npx shadcn@latest add @silicon-ui/theme-switch-splitManually
Install the dependencies
npm install lucide-react motionCopy these files into your project
- components/silicon-ui/theme-switch/theme-switch.tsx
- components/silicon-ui/theme-switch/theme-switch.module.css
Shared with other components. Skip any you already have.
- components/silicon-ui/button/button.tsx
- components/silicon-ui/button/button.module.css
Add the foundation, once per app, for the design and motion tokens
npx shadcn@latest add @silicon-ui/silicon-foundation
Usage
API reference
| Prop | Type | Default |
|---|---|---|
theme* | Theme
| — |
onThemeChange* | (next: Theme, variant: ThemeSwitchVariant, trigger: HTMLElement) => void | — |
variant | ThemeSwitchVariant
| "reveal" |
label | string | — |
iconOnly | boolean | false |