useColorMode | NativeBase | Universal Components for React and React Native

Search
K
Hire us
If you are starting a new project, we recommend using gluestack-ui. For your existing projects, you can utilize @gluestack-ui/themed-native-base (beta).
useColorMode
useColorMode is a custom hook used to get and set the color mode.
Import
Copy
import { useColorMode } from "native-base";
Example
Playground
Return
Name
Type
Description
Default
colorMode
light, dark
The active color mode.
light
setColorMode
function
Use to set color mode.
-
toggleColorMode
function
Use to toggle between light and dark mode.
-
Nativebase logo
MadeWithNativeBase