Rise

The next appearance rises into place.

npx shadcn@latest add @silicon-ui/theme-switch-rise
themeappearancemotion
Loading…

Installation

With the shadcn CLI

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

Manually

  1. Install the dependencies.

    npm install lucide-react motion
  2. Copy these files into your project. Shared files are skipped if you already have them.

    • components/silicon-ui/theme-switch/theme-switch.tsx
    • components/silicon-ui/theme-switch/theme-switch.module.css
    • components/silicon-ui/button/button.tsx shared
    • components/silicon-ui/button/button.module.css shared
  3. Install the foundation once per app for the design and motion tokens: npx shadcn@latest add @silicon-ui/silicon-foundation

Usage

Source codetsx
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