Click Away Listener

Detect clicks or touches that occur outside a wrapped element and trigger a callback.

Import

import { ClickAwayListener } from "@shivms/ui";

Click inside the preview to interact with the content. Click or tap outside the wrapped element to trigger the onClickAway callback.

Basic

Default

Waiting for outside click...

Click inside this box.

States

Default

Waiting for outside click...

Click inside this box.

Active

Waiting for outside click...

Click inside this box.

Inactive

Waiting for outside click...

Click inside this box.

Disabled

Waiting for outside click...

Click inside this box.

Mouse Events

mousedown

Waiting for outside click...

Click inside this box.

mouseup

Waiting for outside click...

Click inside this box.

click

Waiting for outside click...

Click inside this box.

Touch Events

touchstart

Waiting for outside click...

Click inside this box.

touchend

Waiting for outside click...

Click inside this box.