npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

vue-bs-drawer

v1.0.4

Published

Vue.js sidebar drawer component using bootstrap 4 classes

Downloads

56

Readme

vue-bs-drawer

Vue.js sidebar / drawer component using bootstrap 4 classes.

See example here

Getting Started

Prerequisites

You will need to install Bootstrap 4 in your project. You can install using the instructions on the Bootstrap homepage.

Or (recommended) just use the BootstrapVue package.

Installing

Install the via NPM

npm install --save vue-bs-drawer

Register component globally

// Your entry main.js
import Vue from 'vue'
import App from './App'

import VueBsDrawer from 'vue-bs-drawer'

Vue.component('bs-drawer', VueBsDrawer)

or register locally in your .vue file

Example

<template>
  <div id='mycomponent'>>
    <div class="container-fluid">
      <div class="row">
        <bs-drawer v-on:bs-drawer-opened="closeRight"
          ref="leftDrawer"
          side="left"
          :showDrawer="false"
          :showToggleBtn="true"
          btnTop="195px"
          bg="transparent"
          sidebar="md"
          class="col-10 col-sm-3 col-md-3 col-lg-2 bs-drawer__animate">
          <!-- Add some nav elements here-->
        </bs-drawer>

        <div class="px-4 col-12 col-md-9 col-lg-10 offset-md-3 offset-lg-2">
          <!-- Main View here -->
          <router-view></router-view>
        </div>
        <!-- Add another drawer on the other side if needed -->
        <bs-drawer
          ref="rightDrawer"
          side="right"
          :showDrawer="false"
          :btnTop="0"
          class="col-9 col-sm-8 col-md-4 col-lg-4 col-xl-2 bs-drawer__animate">
          <!-- Add some nav elements here-->
        </bs-drawer>

      </div>
    </div>
  </div>
  </div>
</template>

<script>
import 'VueBsDrawer' from 'vue-bs-drawer'
export default {
  components: {
    'bs-drawer': VueBsDrawer
  },
  data () {
    return {
       msg: 'Welcome to Your Vue.js App'
    }
  }
}
</script>

<style>
</style>

Sizing

Use standard Bootstrap col-* classes in the component to size the drawer. e.g.

<bs-drawer v-on:bs-drawer-opened="closeRight"
  side="left"
  class="col-10 col-sm-3 col-md-3 col-lg-2 bs-drawer__animate">
  <!-- Add some nav elements here-->
</bs-drawer>

Responsive Sidebar

Use the sidebar=<size> property to display as a responsive sidebar. Sizes include sm, md & lg.

Then adjust your main content with the correct Bootstrap offset classes. E.g. for size="md and a col-md-3 size, use an offset of offset-md-3.

This will automatically hide your sidebar when the screen size is smaller than the Bootstrap md breakpoint. e.g.

...
<bs-drawer v-on:bs-drawer-opened="closeRight"
  side="left"
  sidebar="md"
  class="col-10 col-sm-3 col-md-3 bs-drawer__animate">
  <!-- Add some nav elements here-->
</bs-drawer>
<div class="px-4 col-12 col-md-9 col-lg-10 offset-md-3">
  <!-- Main View here -->
  <router-view></router-view>
</div>
...

Contributing

serve with hot reload at localhost:8080

npm run dev

distribution build with minification

npm run build

build the docs into gh-pages

npm run build:docs

run unit tests

npm run test:unit

Authors

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Acknowledgments

Inspired by and based on the work done by asyraf9 with the bootstrap-sidebar