Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
ay-menu-button
Advanced tools
A keyboard-accessible, screen-reader-friendly, dropdown menu button library.
Copyright © 2016 Ayogo Health Inc.
<button type="menu">
featureTo get started, install the package from npm: npm install ay-menu-button
.
We'll use this HTML as our example:
<menu id="myMenu" type="context">
<menuitem label="First Item"></menuitem>
<menuitem>Second Item</menuitem>
<menuitem disabled label="Disabled Item"></menuitem>
</menu>
<button id="my-button" data-type="menu" menu="myMenu">Open Menu</button>
Add a script tag to your page to reference the index.js file, and upgrade your button element.
<script src="node_modules/ay-menu-button/dist/index.js"></script>
<script>
var buttonElement = document.getElementById('my-button');
MenuButton(buttonElement);
</script>
You can import ayMenuButton as a CommonJS or AMD module for use with tools like Browserify, RequireJS, and WebPack.
var MenuButton = require('ay-menu-button');
MenuButton(buttonElement);
You can import ayMenuButton as an ES6 module with tools that support jsnext:main
in package.json.
import MenuButton from 'ay-menu-button';
MenuButton(buttonElement);
For convenience and ease of integration with apps already using client-side frameworks, framework integration files are also available.
Currently we only support Angular 1 and Vue, but we are hoping to support native WebComponents.
Use the ay-menu-button/dist/angular1.js
file:
<script src="angular.js"></script>
<script src="node_modules/ay-menu-button/dist/angular1.js"></script>
<script>
angular.module('MyApp', [ayMenuButton]);
</script>
Use the ay-menu-button/dist/vue.js
file:
import Vue from 'vue';
import AyMenuButton from 'ay-menu-button/dist/vue';
Vue.component('ay-menu-button', AyMenuButton);
//...
<menu id="myMenu" type="context">
<menuitem label="First Item"></menuitem>
<menuitem>Second Item</menuitem>
<menuitem disabled label="Disabled Item"></menuitem>
</menu>
<ay-menu-button data-type="menu" menu="myMenu">Open Menu</ay-menu-button>
Released under the terms of the MIT License.
FAQs
An accessible, mobile-friendly drop-down button
The npm package ay-menu-button receives a total of 3 weekly downloads. As such, ay-menu-button popularity was classified as not popular.
We found that ay-menu-button demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.