Home

Awesome

Ember A11y Modal

This addon is intended to provide a simple, accessible, button-triggered modal. For the user with a screen reader, either the modal will exist, or the rest of the page will exist, but never both at the same time.

Please read all of the design details before considering this modal for your application.

Compatibility

Installation

Once this addon is published:

ember install e-a11y-modal

Design

This modal was intentionally designed, and as a result may not fit into an existing application, if it has not previously considered accessibility and other best practices for front-end web design and development. It is intended to be used with application development that follows the best practices of web design and development, and considers accessibility and the user experience from a practical perspective.

The following should be kept in mind when considering use of this addon:

Addons & libraries used in making this addon:

Usage

Example: standard usage

<ModalWindow
  @modalHeadingText="Modal Title"
  @buttonText="I am the modal trigger button">
  {{!-- Any modal content can go in this block --}}
</ModalWindow>

Example: page layout

When the modal is triggered, the landmarks will be marked with inert and aria-hidden="true" will be applied, which will effectively trap the focus inside of the modal while it is open. For the user with a screen reader, either the modal will exist, or the rest of the page will exist, but never both at the same time.

<body>
  
  <header>
    {{!-- header block content here --}}
      <ModalWindow
        @modalHeadingText="Modal Title"
        @buttonText="Login">
          {{!-- Any modal content can go in this block --}}
      </ModalWindow>
  </header>
  
  <main>
    {{!-- main block content here --}}
  </main>

  <footer>
    {{!-- footer block content here --}}
  </footer>

</body>

Contributing

Contributions to this addon are welcome. Contributors should consider the design constraints (listed above in "Design" and "Usage") when submitting a PR for consideration. Please ensure that any PR includes what is being done, tests, and any screenshots that may aid in consideration for inclusion in this addon.

License

This project is licensed under the MIT License.