1.0.20 • Published 4 years ago

react-responsive-navbar-ts v1.0.20

Weekly downloads
6
License
MIT
Repository
github
Last release
4 years ago

react-responsive-navbar

This is a TypeScript rewrite of a React hooks version of react-responsive-navbar.

Nothing crazy, nothing flashy, just a simple, flexible & completely customisable responsive navigation bar component. Check out this demo.

NPM JavaScript Style Guide

Install

pnpm i react-responsive-navbar-ts

Usage

import React from 'react'

import ResponsiveMenu from 'react-responsive-navbar'

const Example = () => (
  <ResponsiveMenu
    menuOpenButton={<div />}
    menuCloseButton={<div />}
    changeMenuOn="500px"
    largeMenuClassName="large-menu-classname"
    smallMenuClassName="small-menu-classname"
    menu={
      <ul>
        <li>Item 1</li>
        <li>Item 2</li>
        <li>Item 3</li>
        <li>Item 4</li>
      </ul>
    }
  />
)

Props

  • menuOpenButton & menuCloseButton: the icons for small screens. I use react-icons in the example however you are free to use any div that you please.
  • changeMenuOn: specify the page width as a string in px that you would like to switch between the small and large menu.
  • menu: takes in any div to create your menu content.
  • You can also specify individual stylings for each of the large or small menus by adding a className to largeMenuClassName or smallMenuClassName

License

MIT © Paige Williams

1.0.20

4 years ago

1.0.19

4 years ago

1.0.18

4 years ago

1.0.17

4 years ago

1.0.16

4 years ago

1.0.15

4 years ago

1.0.14

4 years ago

1.0.13

4 years ago