Yamada UIにスターをあげる

スター
Yamada UIYamada UIv1.5.1

useValue

useValueは、useBreakpointValueuseColorModeValueを組み合わせたカスタムフックです。

ソース@yamada-ui/use-value

インポート

import { useValue } from "@yamada-ui/react"
Copied!

使い方

編集可能な例

const { colorMode } = useColorMode()
const breakpoint = useBreakpoint()
const bg = useValue({
  base: "red.500",
  xl: "blue.500",
  lg: "green.500",
  md: "yellow.500",
  sm: "purple.500",
})
const color = useValue(["whiteAlpha.800", "blackAlpha.800"])

return (
  <Box
    bg={bg}
    p="md"
    rounded="md"
    color={color}
    transitionProperty="all"
    transitionDuration="slower"
  >
    The current breakpoint is "{breakpoint}", colorMode is "{colorMode}"
  </Box>
)
Copied!

GitHubでこのページを編集する

useUpdateEffectuseWindowEvent