📅 You're Invited: Meet the Socket team at RSAC (April 28 – May 1).RSVP
Socket
Sign inDemoInstall
Socket

vue-beercss-navigation

Package Overview
Dependencies
Maintainers
0
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-beercss-navigation

A Vue.js component that provides a customizable navigation rail or drawer, with support to configure entries with icons and labels, with a focus on responsiveness and following Material Design 3 guidelines, implemented with BeerCSS.

1.2.0
latest
npm
Version published
Weekly downloads
4
Maintainers
0
Weekly downloads
 
Created
Source

vue-beercss-navigation

A Vue.js component that provides a customizable navigation rail or drawer, with support to configure entries with icons and labels, with a focus on responsiveness and following Material Design 3 guidelines, implemented with BeerCSS.

Installation

npm install vue-beercss-navigation

Include BeerCSS in your application: Add the following lines to your main.js or app.js file to include BeerCSS and Material Dynamic Colors:

import 'beercss'
import 'material-dynamic-colors'

Usage

Here's how to use the VueBeercssNavigation component in your Vue.js application:

<template>
  <div>
    <VueBeercssNavigation :modelValue="navigationEntries" @close="handleClose" @activeteEntry="handleActiveEntry">
      <template v-slot:top>
        <!-- Custom content for the top slot -->
      </template>
      <template v-slot:bottom>
        <!-- Custom content for the bottom slot -->
      </template>
    </VueBeercssNavigation>
  </div>
</template>

<script>
export default {
  data() {
    return {
      navigationEntries: [
        { name: 'home', label: 'Home', icon: 'home', path: '/' },
        {
          name: 'settings',
          label: 'Settings',
          icon: 'settings',
          entrys: [
            { name: 'profile', label: 'Profile', icon: 'person', path: '/profile' },
            { name: 'account', label: 'Account', icon: 'account_circle', path: '/account' }
          ]
        }
      ]
    };
  },
  methods: {
    handleClose() {
      console.log('Navigation closed');
    },
    handleActiveEntry(entry) {
      console.log('Active entry:', entry);
    }
  }
};
</script>

Props

PropTypeDefaultDescription
modelValueArray[]The array of navigation entries.

Object entry

PropTypeDescription
pathStringThe route path for the navigation entry.
iconStringThe icon for the navigation entry.
labelStringThe label for the navigation entry.
nameStringThe unique name for the navigation entry.
entrysArrayAn array of child navigation entries.

Events

The component emits the following events:

EventDescription
@closeEmitted when the navigation is closed.
@activeteEntryEmitted when an entry is activated. The event payload contains the activated entry object.

Slots

SlotDescription
topSlot for custom content to be placed at the top of the navigation.
bottomSlot for custom content to be placed at the bottom of the navigation.

License

This project is licensed under the MIT License.

Keywords

vue

FAQs

Package last updated on 26 Jul 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts