useBreakpointValue

useBreakpointValue is a custom hook that returns the value of the current breakpoint from the provided object. This hook monitors changes in the window size and returns the appropriate value.

The current breakpoint is "base"

Usage

import { useBreakpointValue } from "@yamada-ui/react"
const bg = useBreakpointValue({
  base: "red.500",
  sm: "purple.500",
  md: "yellow.500",
  lg: "green.500",
  xl: "blue.500",
  "2xl": "pink.500",
})