useContrastText | NativeBase | Universal Components for React and React Native

Nativebase logo
NativeBase
Data Display
Typography
Disclosure
Media and Icons
Others
useContrastText
useContrastText is a custom hook that provides color contrast (either lightText or darkText) to the color being used as a parameter.
Import
Copy
import { useContrastText } from 'native-base';
Examples
Basic
Playground
Using Accessible Colors
By default, NativeBase provides contrasting color based on its theme. You can also choose to get color with better with the help of hook.
Playground
Return value
Accepts and returns a color defined in the theme.
Nativebase logo
MadeWithNativeBase