--- title: useColorModeValue description: "`useColorModeValue` is a custom hook that returns the value of the current color mode from the provided values." links: - source: https://github.com/yamada-ui/yamada-ui/tree/main/packages/react/src/core/system - storybook: https://yamada-ui.github.io/yamada-ui?path=/story/hooks-usecolormodevalue--basic --- # useColorModeValue `useColorModeValue` is a custom hook that returns the value of the current color mode from the provided values. ```tsx const { colorMode } = useColorMode() const color = useColorModeValue("green", "red") return The current colorMode is "{colorMode}" ``` ## Usage ```tsx import { useColorModeValue } from "@yamada-ui/react" ``` ```tsx import { useColorModeValue } from "@/components/ui" ``` ```tsx import { useColorModeValue } from "@workspaces/ui" ``` ```tsx const color = useColorModeValue("green", "red") ``` :::tip For information on using color mode with [Style Props](https://yamada-ui.com/docs/styling/style-props.md), see [Color Mode](https://yamada-ui.com/docs/styling/color-mode.md). :::