We highly recommend the following:
a11y-dialog is a lightweight (1.3Kb) yet flexible script to create accessible dialog windows.
- ✔︎ No dependencies
- ✔︎ Leveraging the native
- ✔︎ Closing dialog on overlay click and ESC
- ✔︎ Toggling
- ✔︎ Trapping and restoring focus
- ✔︎ Firing events
- ✔︎ DOM and JS APIs
- ✔︎ Fast and tiny
You can try the live demo ↗.