Stripe-like Dropdown Menu For Vue.js – Stripe Menu

Description:

Stripe Menu is a Vue.js component to create a minimal clean dropdown nav menu just like you see on the Stripe app.

How to use it:

1. Install and import the Stripe Menu.

import Vue from 'Vue'
import VueStripeMenu from 'vue-stripe-menu'
import 'vue-stripe-menu/dist/vue-stripe-menu.css'

2. Register the component.

Vue.use(VueStripeMenu)

3. Insert the stripe menu component into your template.

<template>
  <vsm-menu
    :menu="menu"
    @open-dropdown="onOpenDropdown"
    @close-dropdown="onCloseDropdown"
  >
    <li
      slot="before-nav"
      class="vsm-section"
    >
      <stripe-logo />
    </li>
    <!--Add a title using the slot:-->
    <!--<template #title="data">{{ data.item.title }}</template>-->
    <template #default="data">
      <component
        :is="data.item.content"
        class="content"
      />
      <component
        :is="data.item.secondary"
        class="content--secondary"
      />
    </template>
    <li
      slot="after-nav"
      class="vsm-section"
    >
      Sign In
    </li>
  </vsm-menu>
</template>

4. Define the menu items.

export default {
  components: {
    StripeLogo
  },
  data () {
    return {
      menu: [
        { title: 'Company', dropdown: 'company', content: DefaultContent, listeners: { mouseover: this.onMouseOver } },
        { title: 'Developers', dropdown: 'developers', content: HorizontalPrimaryContent, secondary: HorizontalSecondaryContent },
        { title: 'Products', dropdown: 'products', content: VerticalContent, element: 'span' },
        { title: 'Source', attributes: { href: 'app.vue', target: '_blank' } }
      ]
    }
  },
  methods: {
    onMouseOver (evt) {
      // console.log('mouse over', evt)
    },
    onOpenDropdown (el) {
      // console.log('open dropdown', el)
    },
    onCloseDropdown (el) {
      // console.log('close dropdown', el)
    }
  }
}

Preview:

Stripe-like Dropdown Menu For Vue.js - Stripe Menu

Changelog:

v2.0.0 (04/10/2021)

  • Added the ability to customize styles in realtime via Demo Website
  • Added a simplified demo of the component to the #Install section
  • Replace default bundle from vue-stripe-menu.common.js to vue-stripe-menu.umd.min.js
  • Fixed animation with problematic dropdown-transition (see new transition-timeout props)
  • Now, when the screen width changes window.addEventListener(‘resize’), the following happens: dropdown is open – location is being recalculated (resizeDropdown function); dropdown is closed – improved logic of instant destruction of styles
  • Added the ability not to install the component globally
  • Add styles
  • Change the code/styles according to the changes below
  • Style changes
  • Classes changes

v1.5.0 (11/17/2020)

  • Added closeDropdown() method for Mobile component

v1.4.0 (09/03/2020)

  • Delete core-js library from dependecies

v1.3.1 (09/03/2020)

  • Fix hide dropdown after scroll on mobile browser

v1.3.0 (08/25/2020)

  • New handler props
  • Bump libraries + audit fix

v1.2.12 (08/06/2020)

  • Bump libraries + audit fix

v1.2.11 (05/25/2020)

  • Bugfix

Download Details:

Author: Alexeykhr

Live Demo: https://alexeykhr.github.io/vue-stripe-menu/

Download Link: https://github.com/Alexeykhr/vue-stripe-menu/archive/master.zip

Official Website: https://github.com/Alexeykhr/vue-stripe-menu

Install & Download:

# Yarn
$ yarn add vue-stripe-menu

# NPM
$ npm install vue-stripe-menu --save

You Might Be Interested In:

Add Comment