--- title: useBreakpointValue description: "`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." links: - source: https://github.com/yamada-ui/yamada-ui/tree/main/packages/react/src/hooks/use-breakpoint - storybook: https://yamada-ui.github.io/yamada-ui?path=/story/hooks-usebreakpointvalue--basic --- ```tsx const breakpoint = useBreakpoint() const bg = useBreakpointValue({ base: "red.500", sm: "purple.500", md: "yellow.500", lg: "green.500", xl: "blue.500", "2xl": "pink.500", }) return ( The current breakpoint is "{breakpoint}" ) ``` ## Usage ```tsx import { useBreakpointValue } from "@yamada-ui/react" ``` ```tsx import { useBreakpointValue } from "@/components/ui" ``` ```tsx import { useBreakpointValue } from "@workspaces/ui" ``` ```tsx const bg = useBreakpointValue({ base: "red.500", sm: "purple.500", md: "yellow.500", lg: "green.500", xl: "blue.500", "2xl": "pink.500", }) ```