Skip to content

Click outside

@xngui/cdk/click-outside
@xngui/cdk/click-outside

Dismiss on pointer events outside the host.

Preview

Dismissible panel

Click anywhere outside this card to dismiss it.

import { XClickOutside } from '@xngui/cdk/click-outside';
 
@if (panelOpen()) {
<div
xClickOutside
[xClickOutsideEnabled]="true"
(xClickOutside)="onOutsideClick()"
>
Panel content
<div>
} @else {
<button (click)="reopen()">Reopen panel<button>
}

Events

Interact with the preview — events will appear here.