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

vue-burger

v1.1.0

Published

Vue.js component/plugin for Hamburgers - Tasty CSS-animated hamburgers

Downloads

46

Readme

About

Vue Burger is a Vue component/plugin that is a wrapper around Tasty CSS-animated hamburgers, wellknown css library for hamburger icons.

Installation

npm install vue-burger
# or
yarn add vue-burger

Initialization

import App from './App.vue';
import VBurger from 'vue-burger';
import Vue from 'vue';

Vue.use(VBurger);

new Vue({
  render: h => h(App),
}).$mount('#app');

VBurger component can be used in without plugin initialization:

<template>
  <v-burger/>
</template>

<script>
import { VBurger } from 'vue-burger';

export default { 
  component: {
    VBurger
  }
}
</script>

Usage

<template>
  <v-burger type="arrow" />
</template>

Props

type

  • type: String,
  • default: 'boring'

burgerStyle

  • type: Object,
  • default: {}

ariaLabel

  • type: String,
  • default: 'Menu'

ariaControls

  • type: String,
  • default: 'navigation'

tabIndex

  • type: Number,
  • default: 0

Types of burger

Available types are:

  • 3dx,
  • 3dx-r,
  • 3dy,
  • 3dy-r,
  • 3dxy,
  • 3dxy-r,
  • arrow,
  • arrow-r,
  • arrowalt,
  • arrowalt-r,
  • arrowturn,
  • arrowturn-r,
  • boring,
  • collapse,
  • collapse-r,
  • elastic,
  • elastic-r,
  • emphatic,
  • emphatic-r,
  • minus,
  • slider,
  • slider-r,
  • spring,
  • spring-r,
  • stand,
  • stand-r,
  • spin,
  • spin-r,
  • squeeze,
  • vortex,
  • vortex-r

You can see all the types in actions on official documentation for Hamburgers.

Styling the burger

For styling regular CSS variables are used. Variables are defined in burgerStyle prop. Available variables:

| Variable | Description | Default value | | ------------------------- | ------------------------------------------- | ------------------ | | --padding | padding of the hamburger box | 15px | | --bg-color | hamburger background color | transparent | | --box-width | hamburger box width | 40px | | --box-height | hamburger box height | 24px | | --layer-width | width of each hamburger layer | 40px | | --layer-height | height of each hamburger layer | 4px | | --layer-bg-color | layer background color | #000000 | | --active-layer-bg-color | layer background color when in active state | --layer-bg-color |

Example:

<template>
  <v-burger 
    :type="arrow" 
    :burgerStyle="burgerStyle">
  </v-burger>
</template>

<script>
  export default {
    data() {
      return {
        burgerStyle: {
          '--padding': '10px',
          '--layer-bg-color': 'yellow',
          '--active-layer-bg-color': '#ABABAB',
          '--layer-width': '20px',
        }
      }
    }
  }
</script>

Slots

Burger has one named slot for setting label for accessability as suggested by Hamburgers author.

| Slot | Description | | ------- | -------------- | | label | label for a11y |

Example:

  <v-burger>
    <template v-slot:label>
      <span class="hamburger-label">Menu</span>
    </template>
  </v-burger>

Events

Burger components emits updated event that exposes the active state. It fires after the burger button is clicked. Check the example for usage.

| Event | Description | Params | | --------- | ---------------------------------------- | ---------------- | | updated | fired after the burger button is clicked | active (Boolean) |

Example with sync modifier:

  <v-burger 
    @update="isActive = $emit
  </v-burger>

Development

# Running examples
npm run serve

# Running tests
npm run test

# Running build
npm run build

Contributing

All contributions are welcome.

License

MIT @ Zdravko Ćurić (zcuric)

Icon made by Freepik from flaticon.