0.0.3-9 • Published 3 years ago

@slickteam/slick-side-menu v0.0.3-9

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

slick-side-menu

Description

A navigation drawer that has a boolean property that states if it's open or closed. When open, an overlay displays and a click on it hides the menu.

Installation

npm i @slickteam/slick-side-menu

Usage

  • Html vanilla
<script type="module">
  import '@slickteam/slick-side-menu';
</script>

<slick-side-menu></slick-side-menu>
  • Vue.js
<template>
    <slick-side-menu
        :avatar="image"
    ></slick-side-menu>
</template>

<script>
import '@slickteam/slick-side-menu';
import image from './path/to/image/file'

export default {
  name: 'TestPage', 
  data() {
      return {
          image: image,
      }
  },
}
</script>

<style scoped>
/* Put CSS */
</style>

Template

    <slick-side-menu
      open
      title="Menu title"
      user
      username="Michel Laboule"
      avatar="importImageHere"
      items="[]"
      color="#FFF"
      background="#f97316"
    ></slick-side-menu>

Properties

NameTypeDescription
openBooleanShows the menu when true
titleStringDefine text content of the menu title
userBooleanShows the user section when true
usernameStringDefine user section name
avatarFileThe user section avatar's image
itemsArrayAn array of items that defines the menu. Structure must be => title = 'My title', to = '/MyHrefLink', icon = 'should be filled with the "d" property of a path tag from a svg tag'
colorStringHex color
backgroundStringHex color

Events

NameDescription
slick-logoutThe event emitted when the logout button is clicked in the user section.
slick-overlayThe event emitted when the overlay is clicked.

Development

Demoing with Storybook

To run a local instance of Storybook for your component, run

npm run storybook

To build a production version of Storybook, run

npm run storybook:build
0.0.3-1

3 years ago

0.0.3-5

3 years ago

0.0.3-4

3 years ago

0.0.3-3

3 years ago

0.0.3-2

3 years ago

0.0.3-9

3 years ago

0.0.3-8

3 years ago

0.0.3-7

3 years ago

0.0.3-6

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago

0.0.0

3 years ago