@nlo/styleguide-menu

A vue component for a fullscreen styleguide menu overlay with searchable items
4,673
Install
npm install @nlo/styleguide-menu
Latest Version:1.0.18
Vue:2
Last Updated:Dec 18, 2023
Links: npm
Maintainer: brandondv-nlo

Styleguide menu

A vue component for a fullscreen styleguide menu overlay with searchable items

Installation

You can install the package through NPM.

npm install @nlo/styleguide-menu

Usage

To use the vue component and render the menu overlay you must first register the library and its components in your javascript boot script.

The necessary configuration should at least contain these lines:

// my-project/styleguide.js

import Vue from 'vue';
import StyleguideMenu from '@nlo/styleguide-menu';

@import "~@nlo/styleguide-menu/dist/styleguide";

function init() {
  StyleguideMenu.init();

  new Vue({
    el: '#styleguide'
  });
}

init();

Then include the vue file in your template and pass the menu items as props to render the styleguide menu overlay in your view.

<template>
    <menu-overlay title="My project" :menu-structure="menuStructure" />
</template>

<script>
  const menuStructure = [
    {
      Description: 'Atoms/Buttons',
      Title: 'Buttons',
      Url: '/styleguide/buttons'
    }
  ];

  export default {
    data() {
      menuStructure
    }
  }
</script>

Customization

There is a small theming system in place that allows you to override a set of variables, very similar to how bootstrap theming works. To make this work you can import a custom sass file in your boot script that could look like:

// my-project/styleguide.scss

// Import the source variables.scss file from the package
@import "~@nlo/styleguide-menu/dist/scss/variables";

$my-color-variable: yellow;

// Override imported variables from the styleguide-menu package with your own variables or values
$nlo-sg-primary-color: $my-color-variable;
$nlo-sg-floating-button-color: white;

// Finally import the styleguide.scss, make sure this is after your overrides
@import "~@nlo/styleguide-menu/dist/styleguide";

Related Packages

@nlo/nuxt-common

Nuxt3 layer for the common user interface of NLO lottery websites

12,245
@nlo/nuxt-application-insights

AppInsights module for Nuxt3

5,308
@nlo/history-api-handler

A lightweight vue component for handling javascript navigation using the browser...

4,285
@nlo/cms-components

Front-end package that provides a UI on top of the QMS back-end

3,706
@nlo/onboarding-tour

A vue plugin for a step by step interactive onboarding tour.

2,529

Version History

Version Released Vue License
1.0.18 ^2.6.11
1.0.17 2.6.11
1.0.16 2.6.11
1.0.15 2.6.11
1.0.14 2.6.11
Pre-releases (8)
Version Released Vue License
1.1.0-alpha.101 2.6.11
1.0.16-alpha.35 2.6.11
1.0.13-alpha.66 2.6.11
1.0.5-alpha.11 ^2.6.11
0.0.1-alpha.130 ^2.6.11