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

ember-dynamic-menu

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ember-dynamic-menu

Dynamic horizontal menu that shows menu items only when there is enough space for them.

  • 1.2.0
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Ember-dynamic-menu

Build Status

Mobile friendly horizontal menu - on wide enough screens it shows all the menu items side-by-side, but once the screen (window width) is not able to show all the menu items, dropdown button is show. You can assign a priority to each menu item - menu item with the lowest priority will be hidden first.

Install

ember install ember-dynamic-menu

Usage

{{#dynamic-menu dropdownButtonWidth=50 position='bottom' dropdownIconClasses='fa fa-caret-down' dropdownTitle='more'}}

  {{#dynamic-menu-item priority=5}}
    {{!-- any template you want for a menu item --}}
    <div class="my-menu-item">
      Press me!
    </div>
  {{/dynamic-menu-item}}

  {{#dynamic-menu-item priority=1}}
    {{!-- any template you want for a menu item --}}
    <div class="my-menu-item">
      Press me #2!
    </div>
  {{/dynamic-menu-item}}

{{/dynamic-menu}}  

Note that each menu item must have the same width. To specify dropdown button width use dropdownButtonWidth property (see example above). You can also specify position of the menu, using property position which can be either top or bottom (default). To customize the dropdown button, you can add any CSS classes to the dropdown button using property dropdownIconClasses - you can add FontAwesome, glypicons, Icomoon icons or whatever you like. You can also add aditional text that will be show under the icon using dropdownTitle property. To make space between menu items equally distributed, you can use enableAutoSpacing (true|false) to enable it (true by default) - just beware: your browser must support flexbox.

Styling


<!-- container element that holds all menu items that are visible -->
.dynamic-menu-container{
    background-color: red;
}

<!-- well, dropdown button... -->
.dropdown-button{
  width: 50px;
  height: 50px;
  background-color: blue;
  display: inline-block;
}

<!-- container element that holds all menu items that are visible after user clicks on dropdown button -->
#dynamic-dropdown{
  background-color: orange;
}

Keywords

FAQs

Package last updated on 18 Jun 2019

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