Please opt in to our enterprise plan (coming soon) for priority support with NativeBase. 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).
useToken
useToken resolves design tokens from the theme.
Import
Copy
import{ useToken }from'native-base';
Example
Playground
functionUseTokenHookExample(){
const[colorPick1, colorPick2]=useToken(// the key within the theme, in this case `theme.colors`
'colors',// the subkey(s), resolving to `theme.colors.warning.1`
['yellow.500','cyan.500']// a single fallback or fallback array matching the length of the previous arg