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

react-header-responsive

v1.1.2

Published

A responsive header for React apps

Downloads

30

Readme

react-header-responsive

A responsive header menu for React applications with submenu support

Features

  • [x] Menu & Submenu
  • [x] Desktop version
  • [x] Mobile version
  • [x] Tablet support
  • [x] Current link highlighting
  • [x] Custom anchor component support
  • [x] Server-side rendering (SSR) support
  • [x] Overlapping (display invisible header over content)

Installation

npm install react-header-responsive

Usage

| Property | Description | | ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | home | Optional. Logo component | | pages | Optional. An array of objects with name and link, or name and children properties. If children is specified it is an array of objects with name and link properties | | access | Optional. Access component for login, registration, etc. | | anchor | Optional. Function with an anchor component | | overlap | Optional. Whether the header should overlap the content and be invisible | | currentPath | Required for SSR only. Used only for server-side rendering (SSR) instead of window.location.pathname |

Example

import Header from 'react-header-responsive';
import logo from './rhr-logo.png';

function App() {
  const pages = [
    {
      name: 'About',
      link: '/about',
    },
    {
      name: 'Products',
      children: [
        {
          name: 'Product-1',
          link: '/product1',
        },
        {
          name: 'Product-2',
          link: '/product2',
        },
        {
          name: 'Product-3',
          link: '/product3',
        },
      ],
    },
    {
      name: 'Pricing',
      link: '/pricing',
    },
  ];

  const Access = () => {
    return (
      <div>
        <button>Sign Up</button>
        <button>Sign In</button>
      </div>
    );
  };

  return (
    <>
      <Header
        home={<img src={logo} alt="RHR logo" />}
        pages={pages}
        anchor={(link, name, className) => (
          <Link href={link} className={className}>
            {name}
          </Link>
        )}
        access={<Access />}
        overlap
      />
    </>
  );
}

Contributing

  1. Clone repo.
  2. Create / checkout feature/{name}, or fix/{name} branch.
  3. Install deps: npm.
  4. Make your changes.
  5. Commit: git commit.
  6. Push: git push.
  7. Open PR targeting the main branch.