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

o2-bootstrap4-component

v0.8.0

Published

# _o2-bootstrap4-component_ Navigation Header Component Library for Bootstrap4 [![MIT License](http://img.shields.io/badge/license-MIT-blue.svg?style=flat)](LICENSE)

Downloads

5

Readme

O2 Bootstrap4 Component

o2-bootstrap4-component Navigation Header Component Library for Bootstrap4

MIT License

o2-bootstrap4-component-consumer is a sample consumer project for o2-bootstrap4-component .

Sample Program for setting config data, https://github.com/ohtsu/o2-bootstrap4-component-consumer/

Video Explanation (English), https://youtu.be/GvcCK-ZR864

Video Explanation (Japanese), https://youtu.be/uCErv1BJBXs

Overview

  • o2-bootstrap4-component is an easy navigation header tool based on ng-bootstrap (version 1.0) for Angular5
  • 8 main colors of Bootstrap are supported (dark,light,primary,secondary,success,info,warning,danger)
  • You can change menu titles by config data.
  • You can customize the log image by config data.
  • You can customize the brand by config data.
  • You can add dropdown lists.
  • You can get click events of Buttons and so on.
  • You can set routing data (routerLink) by config data.

Prerequisite

  • node.js
  • Typescript2
  • Angular5
  • ng-bootstrap

Installation of the sample consumer project

To download this consumer project, in your command line, type as follows:

$ git clone https://github.com/Ohtsu/o2-bootstrap4-component-consumer.git

Change into the project directory

$ cd o2-bootstrap4-component-consumer 

To install it, run simply:

$ npm install 

Start project

If you start local server as follows, you can get a navigation header of Bootstrap4 in your browser by accessing http://localhost:4200.

$ ng serve 
  • First Page

Sample Config Data

You can change settings of the navigation bar by configData as follows.

  private initializeData() {
    this.configData = {
      "Color": {
        "baseColor": "warning",
      },
      "Logo": {
        "id": "logo",
        "name": "DigiPub",
        "visible": false,
        "imageUrl": "assets/images/DigiPub_logo_HighReso01.png",
        "rlink": "/",
      },
      "Brand": {
        "id": "brand",
        "name": "DigiPub",
        "visible": false,
        "rlink": "/",
      },
      "Search": {
        "id": "search",
        "name": "Search",
        "visible": true,
        "rlink": "/",
      },
      "Menu": [
        {
          "id": "m01",
          "dropdown": false,
          "submenu": [],
          "visible": true,
          "title": "Home",
          "rlink": "/",
        },
        {
          "id": "m02",
          "dropdown": false,
          "submenu": [],
          "visible": true,
          "title": "About",
          "rlink": "/about",
        },
        {
          "id": "m03",
          "dropdown": false,
          "submenu": [],
          "visible": true,
          "title": "User",
          "rlink": "/user",
        },
        {
          "id": "m04",
          "dropdown": true,
          "visible": true,
          "title": "Dropdown",
          "rlink": "/detail/child",
          "submenu": [
            {
              "id": "m0401",
              "dropdown": false,
              "visible": true,
              "title": "Home",
              "rlink": "/",
            },
            {
              "id": "m0402",
              "dropdown": false,
              "visible": true,
              "title": "About",
              "rlink": "/about",
            },
            {
              "id": "m0403",
              "dropdown": false,
              "visible": true,
              "title": "User",
              "rlink": "/user",
            },
          ],
        }
      ],
    };

  }

Color

Set your favorite color in Color.baseColor.

dark
light
primary
secondary
success
info
warning
danger

Logo Image

If you want to add your own logo image, you need to add your logo image file into assets/images directory.

Then edit Logo.imageUrl of the configData.

And set Logo.visible true.

Brand

If you want to add your brand, set Brand.visible true.

Then edit Brand.name and Brand.rlinkof the configData.

rlink means routerLink string.

And set Brand.visible true.

Dropdown List

If you want to add dropdown lists, set Menu.dropdown true as follows.

Then add submenu.

Its stricture is the same as Menu.

        {
          "id": "m04",
          "dropdown": true,
          "visible": true,
          "title": "Dropdown",
          "rlink": "/detail/child",
          "submenu": [
            {
              "id": "m0401",
              "dropdown": false,
              "visible": true,
              "title": "Home",
              "rlink": "/",
            },
            {
              "id": "m0402",
              "dropdown": false,
              "visible": true,
              "title": "About",
              "rlink": "/about",
            },
            {
              "id": "m0403",
              "dropdown": false,
              "visible": true,
              "title": "User",
              "rlink": "/user",
            },
          ],
        }

Searchbox

If you want to add searchbox, set Search.visible true.

app.component.html

If you set the configData, app.component.html structue is very simple as follows.


<o2-bootstrap4-component-header [configData]="configData" (buttonClick) ="navButtonClick($event)"></o2-bootstrap4-component-header>

<router-outlet></router-outlet>

Version

  • o2-bootstrap4-component-consumer : 0.1.0
  • o2-bootstrap4-component : 0.4.0
  • Angular5 : 5.2.0
  • TypeScript : 2.5.3
  • @ng-bootstrap/ng-bootstrap : 1.0.0

Reference

Change Log

  • 2018.3.22 version 1.0 uploaded

Copyright

copyright 2018 by Shuichi Ohtsu (DigiPub Japan)