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'
export const Demo = () => {
return <DarkModeToggle />
}Component API
For detailed information about the DarkModeToggle component’s properties, refer to the following:
DarkModeToggle component props
| Prop | Default | Description |
onChange | — | (checked: boolean) => voidCallback |
checked | — | booleanIs toggle checked? |
style | — | React.CSSPropertiesCustom style API |
size | 24 | number | stringSize of the toggle |
animationProperties | — | typeof defaultPropertiesProperties for the animation |
moonColor | — | stringMoon icon color |
sunColor | — | stringSun icon color |
Last updated on