--- 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/hooks/use-color-mode-value - storybook: https://yamada-ui.github.io/yamada-ui?path=/story/hooks-usecolormodevalue--basic --- ```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 Color Mode overview is [here](https://yamada-ui.com/docs/styling/color-mode.md). :::