Focus Trap

Svelte Action

Allows you to contain focus within elements on-demand.

Examples

Usage

Apply use:focusTrap and set the value to true to trap focus, and false to release focus. This will auto-select the first focusable element when activated.

html
<div use:focusTrap={true}>Skeleton</div>