https://github.com/melsumner/ember-a11y-dropdown
A super simple, accessible dropdown component for use in Ember apps.
https://github.com/melsumner/ember-a11y-dropdown
accessibility addon ember
Last synced: 11 months ago
JSON representation
A super simple, accessible dropdown component for use in Ember apps.
- Host: GitHub
- URL: https://github.com/melsumner/ember-a11y-dropdown
- Owner: MelSumner
- License: mit
- Created: 2021-12-21T20:05:11.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2024-11-05T17:19:41.000Z (over 1 year ago)
- Last Synced: 2025-04-07T03:41:30.039Z (about 1 year ago)
- Topics: accessibility, addon, ember
- Language: JavaScript
- Homepage: https://ember-a11y-dropdown.netlify.app/
- Size: 875 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 29
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
Awesome Lists containing this project
README
# ember-a11y-dropdown
**Note: this is not to replace a `` element in a form.**
This is a very simple, accessible dropdown that you can use in your Ember app for something like a menu dropdown-- or [disclosure navigation menu])https://www.w3.org/TR/wai-aria-practices-1.2/examples/disclosure/disclosure-navigation.html)
It's pretty narrow in scope, and there are other addons that do fancier things.
Use this addon if you:
* want to stop using a `details` element (which is an interactive element so cannot contain other interactive elements)
* need a dropdown menu to put in the header or nav of your site (like a user menu)
* are okay with styling the CSS in your app's stylesheets
Whatever else you may be able to force this component to do is coincidental.
## Compatibility
* Ember.js v3.24 or above
* Ember CLI v3.24 or above
* Node.js v12 or above
## Installation
I haven't released this addon yet, but once I do you can install it the same way you do other Ember addons:
```bash
ember install ember-a11y-dropdown
```
## Usage
The component markup:
* a `div` to wrap the entire component so it doesn't mess up your flex or grid layout
* a `button` element to show/hide the dropdown
* a `ul` element that contains the dropdown
* the `LinkTo` components (link element) if a route is defined
* a `li` with `role="separator"` (if needed)
### Styling
The specificity in the addon is kept at single level; it is explicitly only the class names that are attached to each element of the component. That means if you want to override on your own, you can. In fact, it is likely that you'll want to override the default styles.
* the wrapping `