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

reactjs-navigation

v0.3.9

Published

A plug and play responsive navigation bar for React, with dropdowns if required

Downloads

18

Readme

reactjs-navigation

A plug and play navigation bar which handles everything through props.

it is fairly simple but is responsive and can have drop downs if required. The Component should ideally be loaded directly from the Router as shown in the example.

INSTALLATION

`npm i reactjs-navigation --save`

Usage Example:

import React from 'react'
    import {
      BrowserRouter as Router,
    } from 'react-router-dom'
    
    import NavBarNPM from 'reactjs-navigation'
    export default ()=> {
        const options = [
          '/',
          'Gallery',
          'Contact'
        ]
        return(
            <Router>
              <div>
                <NavBarNPM 
                  pages      ={options}
                />
                <div>
                  </div>
              </div>
            </Router>
        )
      }

The basic navbar without dropdown can take the following props, only pages is required as a navbar usually requires at least one!

Navbar props types:

    background             = string
    pages                  = array(required)
    logo                   = string
    logoheight             = string
    color                  = string
    borderRadius           = string
    imgLogoAlt             = string
    dropdown_color         = string
    iconHeight             = string
    iconBorderRadius       = string
    animation              = string
    iconPosition           = string
    angle                  = number 
    the angle props has to be a number between 0 and 2 and it determines the burger menu angle when the menu is open (mobile view))
    0 45deg,  1 90deg, 2 0deg

NAVBAR PROPS DEFALT VALUES

    background              = 'rgba(1,0,0,.9)'
    pages                   =  ['/','gallery','contact','about']
    logo                    = 'https://assets-cdn.github.com/images/modules/logos_page/GitHub-Mark.png'
    logoheight              = '50px'
    color                   = 'white'
    borderRadius            = '30px'
    imgLogoAlt              = 'github'
    iconHeight              = '40px'
    iconBorderRadius        = '10px'
    animation               =  true
    iconPosition            = 'center' (center, 'flex-start', 'flex-end')
    angle                   = 0

USING DROPDOWNS

To use dropdowns all you have to do is to pass one or more page as an objects inside the pages array instead of a string using the following format.

{ 'THE_NAME_OF_YOUR_PAGE': { dropdown:['dropdown1', 'dropdown2']}

DROPDOWN PROPS TYPES

    dropdown_color          = string
    dropdown_minWidth       = string
    shadows                 = bool
    dropdown_marginTop      = string
    dropItem_margin_bottom  = string

DROPDOWN PROPS DEFALT VALUES

    dropdown_color          = 'rgba(1,0,0,.9)'
    dropdown_minWidth       = '200px'
    shadows                 = false
    dropdown_marginTop      = '55px'
    dropItem_margin_bottom  = '10px'

Example passing some optional props and also using dropdowns.

import React from 'react'
    import {
      BrowserRouter as Router,
    } from 'react-router-dom'
    
    import NavBarNPM from 'reactjs-navigation'
    export default ()=> {
        const options = [
          '/',
          {
            'Products':
          { dropdown:['dropdown1', 'dropdown2']}
          },
          {
            'About us':
            {dropdown:['dropdown1', 'dropdown2']}
          }
        ]
        return(
            <Router>
              <div>
                <NavBarNPM 
                  pages      ={options}     
                  background      = 'rgba(1,0,0,.9)'
                  pages           = {options}
                  logo            = 'https://assets-cdn.github.com/images/modules/logos_page/GitHub-Mark.png'
                  logoheight      = '50px'
                  color           = 'white'
                  borderRadius    = '30px'
                  imgLogoAlt      = 'github logo'
                  dropdown_color  = 'rgba(1,0,0,.9)'
                />
                <div>
                  </div>
              </div>
            </Router>
        )
      }

Using Icons

import React from 'react'
import {
  BrowserRouter as Router,
} from 'react-router-dom'
import NavBarNPM from 'reactjs-navigation'
export default ()=> {
    const options = [
      '/',
      {
        'Products':
      { dropdown:['page1', 'page2']}
      },
      {
        'About us':
        {dropdown:['dropdown1', 'dropdown2']}
      },
    { icon:'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSqQ1YbQY6mYVrfFroJNRBYoBBbmDhmtV64WRb6EKwvG0-Dcwd7', 
      page:'user',
      hasDropwDown:true,
      dropdowns:['Register','Login'] 
    }
    ]
    return(
        <Router>
          <div>
            <NavBarNPM 
              pages      ={options}
              iconPosition = 'center'
            />
            <div>
              </div>
          </div>
        </Router>
    )
  }