a11y-dialog is a lightweight yet flexible script to create accessible dialog windows.
✔︎ Closing dialog on overlay click and ESC
✔︎ Trapping and restoring focus
✔︎ Firing events
✔︎ DOM and JS APIs
✔︎ Fast and tiny
You can try the live demo on CodeSandbox.
Originally, this repository was a fork from accessible-modal-dialog by Greg Kraus. It has gone through various stages since the initial implementation and both packages are no longer similar in the way they work.