Theme Toggler
An effect that allows you to toggle the theme gradually.
Made by imskyleenInstallation
Usage
API Reference
ThemeToggler
Prop | Type | Default |
---|---|---|
theme | 'light' | 'dark' | 'system' | - |
resolvedTheme | 'light' | 'dark' | - |
setTheme | (theme: 'light' | 'dark' | 'system') => void | - |
direction? | 'btt' | 'ttb' | 'ltr' | 'rtl' | ltr |
children? | React.ReactNode | ((state: { resolved: "light" | "dark"; effective: "light" | "dark" | "system"; toggleTheme: (theme: "light" | "dark" | "system") => void }) => React.ReactNode) | - |
onImmediateChange? | (theme: 'light' | 'dark' | 'system') => void | - |
Credits
- Credit to Magic UI for the component inspiration.