Skip to content

Split

The next appearance opens from a slim center seam.

ThemeAppearanceMotion
npx shadcn@latest add @silicon-ui/theme-switch-split

Installation

With the shadcn CLI

npx shadcn@latest add @silicon-ui/theme-switch-split

Manually

  1. Install the dependencies

    npm install lucide-react motion
  2. Copy 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
  3. Add the foundation, once per app, for the design and motion tokens

    npx shadcn@latest add @silicon-ui/silicon-foundation

Usage

usage.tsx
import { ThemeSwitch } from "@/components/silicon-ui/theme-switch/theme-switch";

API reference

PropTypeDefault
theme*Theme

"light""dark"

—
onThemeChange*(next: Theme, variant: ThemeSwitchVariant, trigger: HTMLElement) => void—
variantThemeSwitchVariant

"reveal""eclipse""split""rise"

"reveal"
labelstring—
iconOnlybooleanfalse

Dependencies

npm
lucide-reactmotion
Registry
silicon-motion-tokensbutton