Focus Trap โ shadcn/ui Component by reactframe | shadcnregistry
Focus Trap
component
Keeps keyboard focus inside a dialog, drawer or menu while it's open: Tab and Shift+Tab loop through its controls, focus starts where you choose and returns to where it was, Escape calls you back, and an optional ring glides to whatever has focus.