FocusTrap
Focustrap, also known as a focus trap, is a user interface pattern that confines keyboard focus to a designated region while it is active, such as a modal dialog or a settings panel. The goal is to prevent focus from moving to content behind the active element, ensuring that keyboard and assistive technology users can complete tasks without losing context.
How it works: when the trap is activated, focus is moved to the first focusable element within
Common use cases include modal dialogs, overlays, side panels, and step-by-step wizards. Implementations can be built
Accessibility considerations: ensure that focus is moved to a logical starting point, provide a means to dismiss
See also: keyboard navigation, modal dialog, ARIA, accessibility.