Yamada UIにスターをあげる

スター
Yamada UIYamada UIv1.5.1

useBreakpoint

useBreakpointは、現在のブレイクポイントを返すカスタムフックです。このフックは、ウィンドウのサイズの変更を監視し、適切な値を返します。

ソース@yamada-ui/use-breakpoint

インポート

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

使い方

編集可能な例

const breakpoint = useBreakpoint()

return (
  <Box
    bg={{
      base: "red.500",
      xl: "blue.500",
      lg: "green.500",
      md: "yellow.500",
      sm: "purple.500",
    }}
    p="md"
    rounded="md"
    color="white"
    transitionProperty="all"
    transitionDuration="slower"
  >
    The current breakpoint is "{breakpoint}"
  </Box>
)
Copied!

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

useBooleanuseBreakpointEffect