"use client";
import { FocusScope } from "@pixxl-tools/components";| Prop | Type | Default | Description |
|---|---|---|---|
autoFocus | boolean | — | Move focus into the scope on mount (first tabbable, or the scope). |
finalFocus | RefObject<HTMLElement | null> | — | Element to focus on unmount (defaults to the previously focused one). |
initialFocus | RefObject<HTMLElement | null> | — | Element to focus on mount. |
restoreFocus | boolean | — | Return focus on unmount when it is still inside the scope. |
trapped | boolean | — | Keep Tab / Shift+Tab inside the scope (wraps around). |
autoFocusboolean
Move focus into the scope on mount (first tabbable, or the scope).
finalFocusRefObject<HTMLElement | null>
Element to focus on unmount (defaults to the previously focused one).
initialFocusRefObject<HTMLElement | null>
Element to focus on mount.
restoreFocusboolean
Return focus on unmount when it is still inside the scope.
trappedboolean
Keep Tab / Shift+Tab inside the scope (wraps around).
Other props are passed to the root element (HTMLAttributes<HTMLDivElement>), including className, style, id and aria-* attributes.
<FocusScope>...</FocusScope>