react-detect-outside-click-wrapper

A lightweight and reusable React wrapper component that detects clicks outside its children. Perfect for dropdowns, modals, popovers, or any UI that should close when the user clicks outside. Supports optional toggle button refs and TypeScript out of the

@leafyjava/react-click-away

Use this component to wrap other components to detect if it is clicked outside of the wrapped container.