We use focus-trap as a lower-level implementation. It is super lightweight and has minimal dependencies.
Trap focus within a DOM node.
There may come a time when you find it important to trap focus within a
DOM node — so that when a user hits
Tab
or
Shift+Tab
or clicks around, she can"t escape a certain cycle of focusable elements.
Please read the focus-trap documentation to understand what a focus trap is, what happens when a focus trap is activated, and what happens when one is deactivated.