useValue
useValue is a custom hook that combines useBreakpointValue and useColorModeValue.
const breakpoint = useBreakpoint()
const color = useValue({ base: "red", md: "green" })
return <Box color={color}>The current breakpoint is "{breakpoint}"</Box>
"use client" to the top of the file.const { colorMode } = useColorMode()
const color = useValue(["green", "red"])
return <Box color={color}>The current colorMode is "{colorMode}"</Box>
"use client" to the top of the file.Usage
import { useValue } from "@yamada-ui/react"
import { useValue } from "@/components/ui"
import { useValue } from "@workspaces/ui"
const color = useValue({ base: "red", md: "green" })
useValue is using useBreakpointValue and useColorModeValue.Uses Components & Hooks
Used By Components & Hooks
AlphaSlider
AlphaSlider is a component used to allow the user to select color transparency.
Drawer
Drawer is a component for a panel that appears from the edge of the screen.
Group
Group is a component that groups and attaches multiple elements together.
HueSlider
HueSlider is a component used to allow the user to select a color hue.
InfiniteScrollArea
InfiniteScrollArea is a component that provides infinite scrolling functionality. This component offers a smooth scrolling experience by automatically loading and displaying the next dataset when the end of the component is reached.
Reorder
Reorder is a component that allows you to change the order of items using drag and drop.
Resizable
Resizable is accessible resizable panel groups and layouts with keyboard support.
SegmentedControl
SegmentedControl is a component used for allowing users to select one option from multiple choices.
Slide
Slide is a component that shows or hides an element from the corners of the page.
Slider
Slider is a component used for allowing users to select a value from a range.
Steps
Steps is a component that displays the progress of a multi-step process.
Tabs
Tabs is a component for switching between different display areas.