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

drs-navbar

v1.0.2

Published

[![](https://img.shields.io/github/followers/RossiFire?label=Github&style=for-the-badge)](https://github.com/RossiFire)

Downloads

4

Readme

Drs - Navbar

Fully responsive and highly customizable routing based Angular Navbar.

Demo

Simple Example Here

Installation

Using npm:

$ npm i drs-navbar

Usage

Import DrsNavbarModule in your app.module.ts

import { DrsNavbarModule } from 'drs-navbar';

@NgModule({
  declarations:[
    AppComponent
  ],
  imports:[
    DrsNavbarModule
  ],
  providers: [],
  bootstrap: [AppComponent]

Declare a configuration in your .ts file

    drsNavabarConfig: DrsNavbarConfiguration = {
      links:[
        {name: 'Link 1', route: '/route1'},
        {
          name: 'Link 2', 
          route: '/route2',
          dropDownList: 
            [
              {name: 'DropDown 1', key: 0},
              {name: 'DropDown 2', key: '1'},
              {name: 'DropDown 3', key: 2.5}
            ]
        },
        {name: 'Link 3', route: '/route3'},
        {
          name: 'Link 4', 
          route: '/route4',
          dropDownList: 
            [
              {name: 'DropDown 1', key: 'enum'},
              {name: 'DropDown 2', key: 'other'},
              {name: 'DropDown 3', key: ()=> 'hello'}
            ]
        },
      ],
      logoSrc: 'https://link-image.png', // Or local images
      palette: DrsNavbarPalette.SkyPalette
    }

In your HTML file

<drs-navbar [navbarConfiguration]="drsNavabarConfig"></drs-navbar>

Templates

The Navbar needs your custom templates to customize links and dropdowns How to do that:

Both in the links and dropdowns configuration you can pass a custom object with any parameter you want, like this:

drsNavabarConfig: DrsNavbarConfiguration = {
  links:[
    {name: 'Link 1', route: '/route1', custom: {otherIcon: 'icon'}},
    {name: 'Link 2', route: '/route2', custom: {text: 'text'}},
    {
      name: 'Link 3', 
      route: '/route3',
      dropDownList:[
        {name: 'DropDown 1', key: 0, custom: {dropdownIcon: 'icon'}},
        {name: 'DropDown 2', key: 1, custom: {other: 'rehto'}},
        {name: 'DropDown 3', key: 2, custom: }
      ]
    },
    {name: 'Link 4', route: '/route4', custom: {somethingElse: 'else'}},
  ]
}

You can implement your templates in this way:

<!-- To customize main links -->
<ng-template #myLinkTemplate let-link>
  {{link.name}} {{link.custom && link.custom.otherIcon ? link.custom.otherIcon : ''}}
</ng-template>

<!-- To customize all dropdowns single row -->
<ng-template #myDropdownTemplate let-item>
  {{item.name}} {{item.custom && item.custom.dropdownIcon ? item.custom.dropdownIcon : ''}}
</ng-template>

  <drs-navbar 
    [navbarConfiguration]="drsNavabarConfig" 
    [linkTemplate]="myLinkTemplate" 
    [dropdownTemplate]="myDropdownTemplate">
  </drs-navbar>

Properties

Property | Usage | Mandatory ------------- | ------------- | ------------- navbarConfiguration | Main configuration of the navbar. You can set links, logo, color palette,ecc | true
linkTemplate | Main links template | true dropdownTemplate | Dropdown links template | true buttonTemplate | Open/Close custom button template | false

Output

Output | Usage ------------- | ------------- onLinkClick | Main link clicked onDropDownLinkClick | Dropdown link clicked

Other

There are six differents color palette for this navbar:

  • Dark
  • Orange
  • Greeen
  • Red
  • Blue Sky
  • Violet