svogg-components 0.5.4

clickOutside

typescript
import { clickOutside } from 'svogg-components';

Utility for handling clicking outside an element. Useful for e.g. modals and drawers.


Try it out by opening up the console and clicking outside the card in the demo.

Click outside me!

Params

NameTypeRequiredDescription
handler Function true Callback that runs when clicking outside the element.