@source4society/react-scepter-hamburger-menu

2.0.0 • Public • Published

react-scepter-hamburger-menu

Hamburger menu component for use with the scepter navigation HOC

scepter-logo

redux-logo

react-boilerplate

airbnb-codestyle

Build Status

codecov

Installation

npm install @source4society/react-scepter-hamburger-menu

or

yarn install @source4society/react-scepter-hamburger-menu

Usage

This component is intended to be used with react-scepter-navigation-hoc and react-scepter-navigation-menu. Decorating a component will allow it to become a toggle for the navigation menu component via the navigation manager by linking the three together via the reducerKey prop.

Example

First add the manager from react-scepter-navigation-hoc somewhere to your app, such as the Shell.

<NavigationManager reducerKey={'exampleKey'} />

Add a hamburger menu button and decorate it with this component

<HamburgerMenu reducerKey={'exampleKey'}>
  <span className={'hamburger-icon'}></span>
</HamburgerMenu>

Then add the Navigation component from react-scepter-navigation-menu to the page somewhere.

<NavigationMenu reducerKey={'exampleKey'} />

Clicking on the hamburger icon will cause the navigation menu state for the 'exampleKey' navigation to be toggled according to the states defined in react-scepter-navigation-hoc.

The prop onClick has been changed to onInteraction for the purpose of supporting SCEPTER universal UI components.

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
2.0.00latest

Version History

VersionDownloads (Last 7 Days)Published
2.0.00
1.1.40
1.1.30
1.1.20
1.1.10
1.1.00
1.0.00

Package Sidebar

Install

npm i @source4society/react-scepter-hamburger-menu

Weekly Downloads

0

Version

2.0.0

License

AGPL-3.0

Unpacked Size

96.6 kB

Total Files

20

Last publish

Collaborators

  • danfredriksen