Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ayogohealth/ay-menu-button

An accessible drop-down button polyfill
https://github.com/ayogohealth/ay-menu-button

hacktoberfest web-component

Last synced: 5 days ago
JSON representation

An accessible drop-down button polyfill

Awesome Lists containing this project

README

        

ayMenuButton
============

A keyboard-accessible, screen-reader-friendly, dropdown menu button library.

Copyright © 2016 – 2023 Ayogo Health Inc.

Features
--------

* Polyfill for the HTML5 `` feature
* Keyboard accessible and screen-reader friendly
* Smooth animation on desktop and mobile
* Supports IE 10+, Safari, Edge, Chrome, Firefox, iOS 8+, and Android 4.4+

Usage
-----

To get started, install the package from npm: `npm install ay-menu-button`.

We'll use this HTML as our example:

```html


Second Item

Open Menu
```

### Basic usage

Add a script tag to your page to reference the index.js file, and upgrade your
button element.

```html

var buttonElement = document.getElementById('my-button');
MenuButton(buttonElement);

```

### CommonJS/AMD

You can import ayMenuButton as a CommonJS or AMD module for use with tools like
Browserify, RequireJS, and WebPack.

```javascript
var MenuButton = require('ay-menu-button');

MenuButton(buttonElement);
```

### ES6

You can import ayMenuButton as an ES6 module with tools that support `jsnext:main` in package.json.

```javascript
import MenuButton from 'ay-menu-button';

MenuButton(buttonElement);
```

Notes
-----

Released under the terms of the [MIT License](LICENSE).