When you use the
NativebaseProvider at the root of your app, you can automatically use color mode in your apps.
By default, most components are dark mode compatible. To handle color mode manually in your application, use the
useColorMode is a React hook that gives you access to the current color mode, and a function to toggle the color mode.
Calling toggleColorMode anywhere in your app tree toggles the color mode.
useColorModeValue is a React hook used to change any value or style based on the color mode. It takes 2 arguments: the value in light mode, and the value in dark mode.
You can set default color mode. By default, the color mode will be
light. To support this, extend the default theme with a
You can persist the color mode in you app by defining you color mode manager of type
StorageManager and passing it to the NativeBaseProvider. This will retain the color mode even when the app is refreshed.