All Projects → prabhuignoto → Vue Dock Menu

prabhuignoto / Vue Dock Menu

Licence: mit
⚓Dockable Menu bar for Vue

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to Vue Dock Menu

ContextMenuSwift
A better version of iOS 13 Context Menu
Stars: ✭ 162 (-11.48%)
Mutual labels:  menubar, menus, menu
PHP-Quick-Menu
This is a PHP Multilevel Menu class. From nested Json|Array to Html menu (ul)
Stars: ✭ 25 (-86.34%)
Mutual labels:  menubar, menus
vue-bottom-navigation
Vue bottom navigation
Stars: ✭ 56 (-69.4%)
Mutual labels:  menus, menu
WaveSideBar
Animated side bar view
Stars: ✭ 38 (-79.23%)
Mutual labels:  menubar, menu
Side Menu.ios
Animated side menu with customizable UI
Stars: ✭ 2,702 (+1376.5%)
Mutual labels:  menu, menubar
React Site Nav
A kick ass site menu powered by styled components inspired by Stripe.
Stars: ✭ 155 (-15.3%)
Mutual labels:  menu, menubar
ml-stack-nav
Customizable, responsive, accessible, easy-to-use multi-level stack navigation menu with slide effect.
Stars: ✭ 20 (-89.07%)
Mutual labels:  menus, menu
django-menu-generator
A straightforward menu generator for Django
Stars: ✭ 24 (-86.89%)
Mutual labels:  menubar, menu
Superslide.js
A flexible, smooth, GPU accelerated sliding menu for your next PWA
Stars: ✭ 496 (+171.04%)
Mutual labels:  menu, menubar
Sidemenu
Simple side/slide menu control for iOS, no code necessary! Lots of customization. Add it to your project in 5 minutes or less.
Stars: ✭ 5,267 (+2778.14%)
Mutual labels:  menu, menus
Ngsplitmenucontroller
Menu Driven Split view controller
Stars: ✭ 61 (-66.67%)
Mutual labels:  menu, menubar
Pygame Menu
Menu for pygame. Simple, lightweight and easy to use
Stars: ✭ 244 (+33.33%)
Mutual labels:  menu, menus
Spotmenu
Stars: ✭ 2,668 (+1357.92%)
Mutual labels:  menu, menubar
Nocturnal
A Dimness and Night Shift menu bar app for macOS 🌙
Stars: ✭ 199 (+8.74%)
Mutual labels:  menu, menubar
Menu
A JavaScript free menu library for Blazor and Razor Components applications.
Stars: ✭ 118 (-35.52%)
Mutual labels:  menu, menus
Radialmenu
A highly customizable radial menu that's very easy to setup.
Stars: ✭ 371 (+102.73%)
Mutual labels:  menu, menubar
Yndropdownmenu
✨ Awesome Dropdown menu for iOS with Swift 5.0
Stars: ✭ 1,259 (+587.98%)
Mutual labels:  menu, menubar
Chinese Lunar Calendar For Mac
Chinese Lunar Calendar for Mac
Stars: ✭ 150 (-18.03%)
Mutual labels:  menu, menubar
Context Menu.ios
You can easily add awesome animated context menu to your app.
Stars: ✭ 1,854 (+913.11%)
Mutual labels:  menu
Mac Os X App Menu Bar Popup
Mac OS X Application like a menu bar popup message
Stars: ✭ 168 (-8.2%)
Mutual labels:  menubar

logo

Build Status DeepScan grade DeepSource Codacy Badge Language grade: JavaScript Depfu Known Vulnerabilities https://badgen.net/bundlephobia/minzip/vue-dock-menu

demo

Features

  • ⚓  Dock your menu with ease.
  • 🤏  Dock the Menubar by dragging and dropping to the edges of the screen.
  • 👆  Touch support.
  • 👍  Support for nested menus up to any levels.
  • 👓  The Menus adjust to any docked position and enables an intuitive menu navigation.
  • ⌨  Keyboard Accessible.
  • 🎨  Icon support.
  • ⚡  Zero dependencies.
  • 💪  Built with Typescript.
  • 🧰  Intuitive API with data driven behavior.
  • 🌠  Built with the all new Vue 3.

Table of Contents

⚡ Installation

yarn install vue-dock-menu

🚀 Getting Started

vue-dock-menu has some great defaults. Please check the prop section for all available options.

The following snippet creates a simple Menubar and docks it to the top of the page.

<template>
  <vue-dock-menu :items="items">
  </vue-dock-menu>
</template>

<script>
import { DockMenu } from "vue-dock-menu";
import "vue-dock-menu/dist/vue-dock-menu.css";

export default {
  name: "example",
  components: {
    DockMenu
  },
  data() {
    return {
      items = [
        {
          name: "File",
          menu: [{ name: "Open"}, {name: "New Window"}, {name: "Exit"}]
        },
        {
          name: "Edit",
          menu: [{ name: "Cut"}, {name: "Copy"}, {name: "Paste"}]
        }
      ]
    }
  }
}
</script>

sample1

Props

Name Description Default
dock default docking position. Can be any one of TOP, LEFT, RIGHT, BOTTOM TOP
on-selected Callback that will be called on a menu item selection
items Data for the Menu bar []
theme prop to customize the color theme
draggable enables/disbales dragging on the menubar. True

⚓ Dock

use the dock prop to dock the menubar to your preferred position. The prop can accept the following values TOP, BOTTOM, LEFT, RIGHT.

Here we dock the Menu bar to the right side of the screen.

<vue-dock-menu>
  :items="items"
  dock="RIGHT"
</vue-dock-menu>

📡 on-selected

The on-selected prop is used to retrieve the selected menu item. The callback receives an object with name and a path property.

  • name - Name of the selected menu item.
  • path - Full path of the selected menu item.

if you select the Copy menu item under the Edit menu, below would be the payload received on the on-selected callback.

{
  name: "Copy",
  path: "edit>copy"
}

⚡ Populating Menu

Use the items prop to create Simple or Nested menus of your liking.

Here we create a simple Menu structure with 3 Menu items with Edit and Open Recent having sub menus.

  • To include a divider, set an empty item object with just a isDivider property set to true.
  • To disable an item, set disable to true.
const items = [
  { name: "New" },
  { isDivider: true },
  {
    name: "Edit",
    menu: {
      name: "edit-items",
      disable:  true
    },
  },
  { isDivider: true },
  {
    name: "Open Recent",
    menu: {
      name: "recent-items",
    },
  },
  { isDivider: true },
  { name: "Save", disable: true },
  { name: "Save As..." },
  { isDivider: true },
  { name: "Close" },
  { name: "Exit" },
]
  <vue-dock-menu>
    :items="items"
    dock="BOTTOM"
  </vue-dock-menu>

🎨 Custom color scheme

use the theme prop to customize the colors of the menu bar.

  <menu-bar
    :items="items"
    :on-selected="selected"
    :theme="{
      primary: '#001B48',
      secondary: '#02457a',
      tertiary: '#018abe',
      textColor: '#fff'
    }"
  />

theme

🎭 Icon support

Each menu item can be iconified and the component uses slots to inject the icons.

Pass individual icons (or images) as templates marked with a unique slot id. please make sure the ids match the iconSlot property in the items array.

<menu-bar
  :items="items"
  :on-selected="selected"
>
  <template #file>
    <img
      src="../assets/file.svg"
      alt="file"
      :style="style"
    >
  </template>
  <template #window>
    <img
      src="../assets/window-maximize.svg"
      alt="file"
      :style="style"
    >
  </template>
</menu-bar>

export default defineComponent({
  name: "MenuExample",
  data()  {
    return {
      items: [
        { name: "New File", iconSlot: "file" },
        { name: "New Window", iconSlot: "window" },
      ]
    }
  }
})

menu-icon

This works seamlessly even for nested menu structure. Make sure the slot ids match and the component will render the icons appropriately.

<menu-bar
  :items="items"
  :on-selected="selected"
>
  <template #window>
    <img
      src="../assets/window-maximize.svg"
      alt="file"
      :style="style"
    >
  </template>
</menu-bar>

export default defineComponent({
  name: "MenuExample",
  data()  {
    return {
      items: [
        { name: "New File",
        subMenu: [{ name: "New Window", iconSlot: "window" }]},
      ]
    }
  }
});

What's coming next

  • support for react.
  • accordion style rendering on sidebar mode.

📦 Build Setup

# install dependencies
yarn install

# start dev
yarn run dev

# package lib
npm run rollup

# run css linting
yarn run lint:css

🔨 Contributing

  1. Fork it ( https://github.com/prabhuignoto/vue-dock-menu/fork )
  2. Create your feature branch (git checkout -b new-feature)
  3. Commit your changes (git commit -am 'Add feature')
  4. Push to the branch (git push origin new-feature)
  5. Create a new Pull Request

🧱 Built with

📄 Notes

  • The project uses vite instead of @vue/cli. I choose vite for speed and i also believe vite will be the future.

Meta

Prabhu Murthy – @prabhumurthy2[email protected]

https://www.prabhumurthy.com

Distributed under the MIT license. See LICENSE for more information.

https://github.com/prabhuingoto/

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].