Skip to content

Color mode based on device settings #4361

Answered by kaili-kameoka
haibert asked this question in Q&A
Discussion options

You must be logged in to vote

You can create a custom theme with a config like this:

    useSystemColorMode: true
  };

  const customTheme = extendTheme({ config });

Then, pass the custom theme in the theme prop of the NativeBaseProvider

Docs: https://docs.nativebase.io/color-mode

If you're using expo, you may also need to modify the app.json so that the ios and android platforms have the following:

"userInterfaceStyle": "automatic",

Docs: https://docs.expo.dev/guides/color-schemes/

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by haibert
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants