DarkModeToggle
The DarkModeToggle is a user-friendly switch allowing users to easily flip between light and dark themes within the application. It provides a convenient way to support users' preference for their viewing mode and can help enhance readability and visual comfort.
Usage
Here's how you can incorporate the DarkModeToggle component into your application:
import { DarkModeToggle } from '@creation-ui/react'
;<DarkModeToggle />
Component API
For detailed information about the DarkModeToggle component's properties, refer to the following:
Prop | Default | Description |
onChange | — | (checked: boolean) => void Callback |
checked | — | boolean Is toggle checked? |
style | — | React.CSSProperties Custom style API |
size | 24 | number | string Size of the toggle |
animationProperties | — | typeof defaultProperties Properties for the animation |
moonColor | — | string Moon icon color |
sunColor | — | string Sun icon color |