useHover
useHover
is a custom hook that detects whether the pointer has moved over or away from an element.
Import
import { useHover } from "@yamada-ui/react"
Usage
Editable example
const { hovered, ref } = useHover() return ( <Box ref={ref} w="full" bg="red.500" p="md" rounded="md" color="white"> {hovered ? "I am hovered" : "Put mouse over me please"} </Box> )
Edit this page on GitHub