2.0.0 • Published 3 months ago

@inotom/vue-nav-drawer v2.0.0

Weekly downloads
3
License
MIT
Repository
github
Last release
3 months ago

@inotom/vue-nav-drawer

A Vue.js component to toggle navigation drawer menu container.

From v2.0.0, it works for Vue 3.

Demo

Demo

Install

Browser

<script src="vue.global.prod.js"></script>
<script src="vue-nav-drawer.umd.js"></script>

npm

npm install --save @inotom/vue-nav-drawer

Usage

Browser

<div id="app">
  <nav-drawer-handle></nav-drawer-handle>
  <nav-drawer-custom-handle>MENU</nav-drawer-custom-handle>
  <nav-drawer>
    MENU LIST
    <nav-drawer-custom-close-handle>CLOSE</nav-drawer-custom-close-handle>
  </nav-drawer>
</div>

<script src="vue.global.prod.js"></script>
<script src="vue-nav-drawer.umd.js"></script>
<script>
const { createApp } = Vue;
const { NavDrawer, NavDrawerHandle, NavDrawerCustomHandle, NavDrawerCustomCloseHandle } = SwsVueNavDrawer;

createApp({
  components: {
    NavDrawer,
    NavDrawerHandle,
    NavDrawerCustomHandle,
    NavDrawerCustomCloseHandle,
  },
}).mount('#app');
</script>

SFC (TypeScript)

<template>
  <nav-drawer-handle></nav-drawer-handle>
  <nav-drawer-custom-handle>MENU</nav-drawer-custom-handle>
  <nav-drawer>
    MENU LIST
    <nav-drawer-custom-close-handle>CLOSE</nav-drawer-custom-close-handle>
  </nav-drawer>
</template>

<script setup lang="ts">
import {
  NavDrawer,
  NavDrawerHandle,
  NavDrawerCustomHandle,
  NavDrawerCustomCloseHandle
} from '@inotom/vue-nav-drawer';
</script>

Props

NavDrawerHandle

PropsTypeDefaultDescription
drawer-keyString"default"Key string for drawer identification
sizeNumber50Hamburger menu size(px)
weightString"normal"Hamburger menu line width (normal, thin, bold)
colorString"#fff"Hamburger menu line color
bg-colorString"#f6ac1d"Hamburger menu background color
fsizeString"10px"Menu label text size
is-buttonBooleanfalseAdd WAI-ARIA role button attribute

NavDrawer

PropsTypeDefaultDescription
drawer-keyString"default"Key string for drawer identification
is-leftBooleanfalseDrawer container align left
bg-colorString"#fff"Drawer container background color
cover-opacityNumber0.5Drawer background layer opacity
disable-close-buttonBooleanfalseHide close button
media-queryString"(max-width: 640px)"Enable drawer conditional
topString"0px"Drawer top position
z-indexNumber1000Drawer z-index
is-buttonBooleanfalseAdd WAI-ARIA role button attribute to close icon
drawer-widthString80vwDrawer container width

NavDrawerCustomHandle

PropsTypeDefaultDescription
drawer-keyString"default"Key string for drawer identification
is-buttonBooleanfalseAdd WAI-ARIA role button attribute

NavDrawerCustomCloseHandle

PropsTypeDefaultDescription
drawer-keyString"default"Key string for drawer identification
is-buttonBooleanfalseAdd WAI-ARIA role button attribute

License

MIT

Author

inotom

2.0.0

3 months ago

2.0.0-beta.6

4 months ago

2.0.0-beta.2

4 months ago

2.0.0-beta.5

4 months ago

2.0.0-beta.4

4 months ago

2.0.0-beta.3

4 months ago

2.0.0--beta.1

4 months ago

1.2.0

4 years ago

1.1.0

6 years ago

1.0.2

6 years ago

1.0.0

6 years ago