Version: 3.0.0

Using Theme

NativeBase provides multiple tools to use the central theme defined in the app. First tool is useTheme, which you can use to access the values from the current theme.



You can also get specific values from the theme with useToken hook.


If you are defining the background yourself and pass a contrasting color to the text then you can use useContrastText.


If you want to define some conditionals based on current color mode or change the color mode then you can try useColorMode.


If you do not want to add conditionals for color mode everywhere and keep the code clean, then you can use useColorModeValue hook. It takes two parameters, light mode value as the first and dark mode value as second.