Content-Length: 181790 | pFad | https://docs.nativebase.io/use-color-mode
Copyimport { useColorMode } from "native-base";
Playgroundfunction UseColorMode() {const {colorMode,toggleColorMode} = useColorMode();return <Center><Box p="4" flex="1" maxW="300" mt={10} w="100%" bg={colorMode === "dark" ? "coolGray.800" : "warmGray.50"} safeArea><Text fontSize="lg" display="flex" mb="20">The active color mode is{" "}<Text bold fontSize="lg">{colorMode}</Text></Text><Button onPress={toggleColorMode} h={10}>Toggle</Button></Box></Center>;}const Example = () => {return <NativeBaseProvider><UseColorMode /></NativeBaseProvider>;};
Fetched URL: https://docs.nativebase.io/use-color-mode
Alternative Proxies: