New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@servicensw/drop-menu

Package Overview
Dependencies
Maintainers
3
Versions
133
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@servicensw/drop-menu

Drop menu component

  • 2.0.0-dev.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
18
decreased by-35.71%
Maintainers
3
Weekly downloads
 
Created
Source

@servicensw/drop-menu

Drop menu sharing component

Turn a list into an accessible drop-menu that opens and closes.

Installation

npm install @servicensw/drop-menu --save-dev

How to use

1. Include CSS

  • PostCSS workflow: @import '@servicensw/drop-menu';
  • Sass/Eyeglass: @import 'servicensw-drop-menu';
  • Native CSS: @import url('dist/css/drop-menu.css');
  • Link tag: <link href="dist/css/drop-menu.css" rel="stylesheet" type="text/css">

2. Include JS

  • CommonJS/ES6: import DropMenu from '@servicensw/drop-menu';

3. Add HTML and call JS

HTML:

<div class="drop-button__wrapper">
  <p id="dropMenuDescription">Select an option from the list</p>
  <div class="drop-button">
    <ul aria-label="Drop menu" aria-describedby="dropMenuDescription">
      <li><a href="#">Option 1</a></li>
      <li><a href="#">Option 2</a></li>
      <li><a href="#">Option 3</a></li>
      <li><a href="#">Option 4</a></li>
    </ul>
  </div>
</div>

JS:

document.addEventListener('DOMContentLoaded', () => {
  const dropMenus = document.querySelectorAll('.drop-button');
  if (dropMenus) {
    dropMenus.forEach((element, index) => {
      const dropMenu = new DropMenu(element, index); // eslint-disable-line no-unused-vars
    });
  }
});

FAQs

Package last updated on 20 Aug 2018

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc