Dark Mode #627
Unanswered
dev-fredericfox
asked this question in
Q&A
Dark Mode
#627
Replies: 1 comment
-
import {useColorScheme} from 'react-native';
import {COLORMODES} from '@gluestack-style/react/lib/typescript/types';
export default function App() {
const colorMode = useColorScheme() as COLORMODES; //dark | light
return (
<GluestackUIProvider config={config} colorMode={colorMode}>
<Something />
</GluestackUIProvider>
);
} then in the config or in components use <VStack
bg="$white"
sx={{
_dark: {
bg: '$backgroundDark950',
}
}}
> |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I was wondering how dark mode should be implemented. I see that I can pass custom dark colors with
And in react native I can check what mode the user has set with
useColorScheme()
, but how do I tell gluestack to switch to dark mode?Edit: I have tried passing light or dark into colorMode={scheme} in
<GluestackUIProvider config={config.theme} colorMode={scheme}>
but nothing happens.Beta Was this translation helpful? Give feedback.
All reactions