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-hamburger-menus

v1.0.16

Published

A react library for creating animated hamburger menu with CSS transitions.

Downloads

494

Readme

react-hamburger-menus

Congrats! You just saved yourself hours of work by using react-animated-navbars library for creating animated navigation panels

Demo

Take a look at the live demo!

Installation

install it using npm or yarn to include it in your own React project

You will also need to import css modules in root your project before using it. dist/react-animated-navbars.cjs.development.css

npm

npm i react-hamburger-menus

yarn

yarn add react-hamburger-menus

Usage

Ghost Navbar

  • Import GhostNavbar component from react-animated-navbars
  • Import styles react-animated-navbars/dist/style.css
import React from "react";
import { GhostNavbar } from "react-hamburger-menus";
import "react-hamburger-menus/dist/style.css";

const App = () => {
  return (
    <>
      <GhostNavbar
        styles={{
          floatButtonSize: 0.9,
          floatButtonX: 6,
          floatButtonY: 4
        }}
      >
        <ul>
          <li>ABOUT</li>
          <li>PROJECTS</li>
          <li>ELEMENTS</li>
          <li>CONTACT</li>
        </ul>
      </GhostNavbar>
    </>
  );
};

export default App;

Using with next js/ Gatsby js or other React Framework for application routing

import Link from 'next/link'
.
.
  <ul>
    <li>
      <Link href="/"> Home </Link>
    </li>  
    .
    .

🔨 API

Props

Direct props use ul tag with li or else animations wont be applied

| Prop | Type | Default | Description | | ------------------- | ---------------- | --------------------- | ---------------------------------------------------------------------------------------------------------------- | | children | ReactNode (ul > li) | optional | Navbar items | | className | string | optional | Base class | | styles | styles object | optional | Base styles | | iconHeight, iconWidth, iconColor | string | optional | Icon style | | floatButtonX | number | 85 | Ghost button X position from right | | floatButtonY | number | 2 | Ghost button Y position from top | | listHoverColor | [string, string] | [color 1, color 2] | Hover animation color | | fontColor, fontSize, fontHoverColor | optional | string | common text styling | | zIndex | number | optional | z-Index (1000) | | leftReveal, rightReveal, backgroundBox, backgroundCircle | string | leftReveal backgroundCircle | annimation types |

STYLES

If you want custom styles pass your CSS styling(Javascript Object) in Styles props using specific key mentioned below to apply styling correctly.

Take a look at the live demo for custom styling!

| Property | Type | Default | Description | | ------------------- | ---------------- | --------------------- | ---------------------------------------------------------------------------------------------------------------- | | navigation | React CSS Properties | optional | Base styling | | navigationButton | React CSS Properties | optional | Ghost button styling | | navigationIcon | React CSS Properties | optional | Ghost icon styling | | navigationBackground | React CSS Properties | optional | Panel background styling |

Responsive Navbar

Preview

Small screen

Large screen

import React from "react";
import { ResponsiveNavbar } from "react-hamburger-menus";
import "react-hamburger-menus/dist/style.css";

export const Default = () => (
  <ResponsiveNavbar
    logo={<p>Logo</p>}
    styles={{
      navigation: { fontFamily: 'Arial, Helvetica, sans-serif' },
      navigationBarSmall: {
        backgroundColor: 'aliceblue',
      },
      navigationCardSmall: {
        backgroundColor: 'aliceblue',
      },
    }}
  >
      <ul>
        <li>ABOUT</li>
        <li>PROJECTS</li>
        <li>ELEMENTS</li>
        <li>CONTACT</li>
      </ul>

  </ResponsiveNavbar>
);

🔨 API

Props

Direct props use ul tag with li or else animations wont be applied

| Prop | Type | Default | Description | | ------------------- | ---------------- | --------------------- | ---------------------------------------------------------------------------------------------------------------- | | children | ReactNode (ul > li) | optional | Navbar items | | className | string | optional | Base class | | styles | styles object | optional | Base styles | | logo | ReactNode | optional | Navbar logo | | iconColor, iconWidth, iconHeight | string | optional | Icon styling (toggle) | | zIndex | number | optional | z-Index (1000) | | animationDelay | number | string | optional | animation delay | | toggleNavigationBarSmallValue | boolean | optional | manual toggle value | | toggleNavigationBarSmallFunction | VoidFunction | optional | manual toggle function |

STYLES

If you want custom styles pass your CSS styling(Javascript Object) in Styles props using specific key mentioned below to apply styling correctly.

Take a look at the live demo for custom styling!

| Property | Type | Default | Description | | ------------------- | ---------------- | --------------------- | ---------------------------------------------------------------------------------------------------------------- | | navigation | React CSS Properties | optional | Base styling | | navigationBarSmall | React CSS Properties | optional | Navbar small screen styling | | navigationButtonSmall | React CSS Properties | optional | Navbar button small screen styling (toggle) | | navigationCardSmall | React CSS Properties | optional | Navbar card small screen styling (toggle) | | navigationBarLarge | React CSS Properties | optional | Navbar card large screen styling (toggle) |

Ghost Button

import React from "react";
import { GhostButton } from "react-hamburger-menus";
import "react-hamburger-menus/dist/style.css";

const App = () => {
  return (
    <>
      <GhostButton
        styles={{
          floatButtonX: 85,
          floatButtonY: 7
        }}
      >
          <ul>
          <li>ABOUT</li>
          <li>PROJECTS</li>
          <li>ELEMENTS</li>
          <li>CONTACT</li>
        </ul>
        </GhostButton>
    </>
  );
};

export default App;

Using icon or html (as icon)

.
  <GhostButton
    icon={
      <p style={{ fontSize: '19px', borderBottom: '1px solid grey' }}>Users</p>
    }
    />
.
.

🔨 API

Props

| Prop | Type | Default | Description | | ------------------- | ---------------- | --------------------- | ---------------------------------------------------------------------------------------------------------------- | | children | ReactNode (ul > li) | optional | Navbar items | | className | string | optional | Base class | | styles | styles object | optional | Base styles | | icon | ReactNode | optional | custom icon | | floatButtonSize | number | optional | Ghost button size (just number) | | floatButtonX | number | 85 | Ghost button X position from right | | floatButtonY | number | 2 | Ghost button Y position from top | | fontColor, fontSize | optional | string | common text styling | | iconHeight, iconWidth, iconColor | string | optional | Icon style | | listHoverColor | string | aqua | Hover animation color | | zIndex | number | optional | z-Index (1000) |

STYLES

Take a look at the live demo for custom styling!

| Property | Type | Default | Description | | ------------------- | ---------------- | --------------------- | ---------------------------------------------------------------------------------------------------------------- | | navigation | React CSS Properties | optional | Base styling | | navigationButton | React CSS Properties | optional | Ghost button styling | | navigationIcon | React CSS Properties | optional | Ghost icon styling | | navigationCard | React CSS Properties | optional | Panel pop-up card styling |

🐛 Bug Reporting

The Library is in developing stage

  • Feel free to Open an issue on GitHub to request any additional features you might need for your use case.
  • Connect with me on LinkedIn. I'd love ❤️️ to hear where you are using this library.

Browser support

Because this project uses CSS3 features, it's only meant for modern browsers. Some browsers currently fail to apply some of the animations correctly.

It is well tested for chrome, safari and firefox.

📜 License

This software is open source, licensed under the MIT License.