focus-trap-improved
v1.0.3
Published
A simple TypeScript npm package to lock focus within a specified container. This package helps ensure that keyboard navigation stays within a particular section of a webpage, improving accessibility and user experience.
Downloads
10
Maintainers
Readme
Focus Trap Improved
A simple TypeScript npm package to lock focus within a specified container. This package helps ensure that keyboard navigation stays within a particular section of a webpage, improving accessibility and user experience.
Installation
To install the focus-trap-improved
package, use npm:
npm install focus-trap-improved
Usage
Simple import the package:
import FocusTrapImproved from "focus-trap-improved"
Add this line to either an eventlistener or a function
new FocusLocker();
add the class focus-trap
to the element and thats it!