useOutsideClick

useOutsideClick is a custom hook that detects click events outside of an element.

Usage

import { useOutsideClick } from "@yamada-ui/react"
const { open, onOpen, onClose } = useDisclosure()

useOutsideClick({
  ref,
  handler: onClose,
})

Used By Components & Hooks

Popover

Popover is a component that floats around an element to display information.

Tooltip

Tooltip is a component that displays short information, such as supplementary details for an element.