# XWUIOverlayFocusTrap

Utility component to trap focus within a container Essential for accessible Modals, Drawers, and Popovers

## Basic Usage

XWUIOverlayFocusTrap Component Utility component to trap focus within a container Essential for accessible Modals, Drawers, and Popovers.

```example
file: examples/BasicUsage.ts
html: examples/BasicUsage.html
title: Basic Usage
description: XWUIOverlayFocusTrap Component Utility component to trap focus within a container Essential for accessible Modals, Drawers, and Popovers.
```

## Trap in a Panel

Traps keyboard focus inside a dialog-like panel and moves focus to the first field on activation - the accessibility contract every modal needs.

```example
file: examples/TrapInPanel.ts
html: examples/TrapInPanel.html
title: Trap in a Panel
description: Traps keyboard focus inside a dialog-like panel and moves focus to the first field on activation - the accessibility contract every modal needs.
```

## Release on Close

The full trap lifecycle: opening a panel activates the trap, and its Close button deactivates it, returning focus to the trigger that opened it.

```example
file: examples/ReleaseOnClose.ts
html: examples/ReleaseOnClose.html
title: Release on Close
description: The full trap lifecycle: opening a panel activates the trap, and its Close button deactivates it, returning focus to the trigger that opened it.
```

```api
```
