npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@profesia/vue-hamburger-menu-component

v2.0.4

Published

Vue Components for hamburger menu on mobile

Downloads

4

Readme

vue-accordion-component

npm npm total vue2

Install

NPM

Install the package:

npm install @profesia/vue-hamburger-menu-component --save-dev

Then import it in your project

import Vue from 'vue'
import { hamburgerMenu, hamburgerMenuButton } from '@profesia/vue-hamburger-menu-component'

new Vue({
    el: '#your-element',

    components: {
        hamburgerMenuButton,
        hamburgerMenu,
    },
});

Usage

Simply use it like so:

<hamburger-menu-button></hamburger-menu-button>
<hamburger-menu>
    ... your menu ...
</hamburger-menu>

Settings

setBreakPoint

There is possibility to set, which breakpoint should be used to change mobile menu to normal menu on. You need to call hamburgerMenuComponent.changeOnBreakPoint to set new value. Set none for mobile menu on each size. Defaults to xs.

created() {
    hamburgerMenuComponent.changeOnBreakPoint = 'sm'
}
openMenu

You can call hamburgerMenuComponent.isOpened with true to open your menu on some action. Defaults to false.

hamburgerMenuComponent.isOpened = true
closeMenu

You can call hamburgerMenuComponent.isOpened with false to open your menu on some action. Defaults to false.

hamburgerMenuComponent.isOpened = false

Structure

Once the menu has been rendered, it'll create the following structure:

HTML

menu button
<div class="module-hamburger-menu-button hamburger-button-xs">
    <span></span>
    <span></span>
    <span></span>
    <span></span>
</div>
menu
<div class="module-hamburger-menu module-hamburger-menu-open hamburger-xs">
    <div class="module-hamburger-menu-content">
        <div class="module-hamburger-menu-container">
            <!-- Your own menu -->
            <ul>
                <li><a href="#1">Link 1</a></li>
                <li><a href="#2">Link 2</a></li>
                ...
            </ul>
        </div>
    </div>
</div>

CSS

All CSS is based uppon this structure.

.module-hamburger-menu-button {
  ...
}

.module-hamburger-menu-button span {
  ...
}
Relative menu

Menu's default position is absolute, so menu is flying over your content on mobile. If you need to shift your content, add to your CSS this code.

.module-hamburger-menu-content{
  position: relative;
}

FAQ

  • Where can I see, how it works? - Go to DEMO and enjoy ;)
  • How can I provide feedback? - Send an email to [email protected]; any feedback is appreciated.

Release History

  • 2.0.4 Fix high z-index for menu container
  • 2.0.3 Add option none for changeOnBreakPoint prop to have hamburger menu on each size
  • 2.0.2 Fix css position on opened menu
  • 2.0.1 Edit styles for show/hide menu
  • 2.0.0 Hamburger menu without Store
  • 1.0.1 Fix README
  • 1.0.0 Official release with docs
  • 0.0.1 Initial release