modal / dialog
A third party plugin we use to produce an accessible modal / dialog component.
The modal / dialog component is one that is frequently used in UI design and popular enough to where we don’t feel like we need to reinvent the wheel. After an exhaustive search for a third party plugin that met all of our accessibility and implementation requirements, we were able to settle on using A11yDialog by Kitty Giraudel. This plugin is fully WCAG 2.1 compliant, lightweight, has a robust API, no dependencies, and properly manages focus.
NOTE:
In early 2021, A11yDialog 7.0 was released and introduced breaking changes. A summary of those changes include:
- No more support for the
<dialog>
HTML element - No more usage of the open HTML attribute
- Different expected markup
- More flexible position in the DOM
Documentation for Migraging to v7.
A11yDialog also has React and Vue versions we can leverage for projects in those environments.
Usage
Documentation
Installation
You can view full documentation for this component in the A11yDialog repository and the official A11yDialog Doucmentation Site. This documentation should be enough to get you going. There is also a demo on CodeSandbox.
npm install a11y-dialog --save
Browser Compatibility
Chrome | Latest |
---|---|
Firefox | Latest |
Edge | Latest |
Safari | Latest |
IE | IE 11+ |