Components/Components

Theme Toggler

A minimal theme toggle button with a cinematic full-screen curtain wipe animation. Supports vertical and horizontal directions.

themedark-modetoggle

Preview

Installation

npx shadcn@latest add https://grootstudio.vercel.app/r/theme-toggler.json

Usage

Props

PropTypeDefaultRequiredDescription
direction'vertical' | 'horizontal''vertical'Direction of animation: Vertical sweeps top-to-bottom, horizontal sweeps left-to-right.
durationnumber550Duration of animation in milliseconds.
defaultTheme'light' | 'dark''light'Initial theme. Auto-detected from the document's dark class.
onThemeChange(theme: Theme) => voidCallback fired after the theme change animation completes.
classNamestringAdditional Tailwind classes for custom styling.

Dependencies

lucide-react