UNPKG

@logo-elements/menu-bar

Version:

A web component for creating a horizontal button bar with hierarchical drop-down menus.

50 lines (46 loc) 1.21 kB
import {html, PolymerElement} from '@polymer/polymer/polymer-element.js'; import { MenuBar } from '@vaadin/menu-bar'; /** * # @logo-elements/menu-bar * * A web component for creating a horizontal button bar with hierarchical drop-down menus. * * [![npm version](https://badgen.net/npm/v/@logo-elements/menu-bar)](https://www.npmjs.com/package/@logo-elements/menu-bar) * * ```html * <logo-elements-menu-bar></logo-elements-menu-bar> * * <script> * document.querySelector('logo-elements-menu-bar').items = [ * { text: 'View' }, * { text: 'Edit' }, * { * text: 'Move', * children: [{ text: 'To folder' }, { text: 'To trash' }] * }, * { text: 'Duplicate' } * ]; * </script> * ``` * * ## Installation * * Install the component: * * ```sh * npm i @logo-elements/menu-bar -s * ``` * * Once installed, import the component in your application: * * ```js * import '@logo-elements/menu-bar'; * ``` * */ class LogoElementsMenuBar extends MenuBar { static get is() { return 'logo-elements-menu-bar'; } } if (!window.customElements.get(LogoElementsMenuBar.is)) { window.customElements.define(LogoElementsMenuBar.is, LogoElementsMenuBar); }