1.0.1 • Published 4 years ago

animated-burger-menu v1.0.1

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

animated-burger-menu

An overlay React Menu with a collection of effects and styles using CSS transitions.

Demo & examples

Live demo: here

Installation

The easiest way to use animated-burger-menu is to install it from npm and include it in your own React build process (using Browserify, Webpack, etc).

npm install animated-burger-menu

Usage

Items for the sidebar should be passed as child elements of the component using JSX.

import  BurgerMenu  from  'animated-burger-menu'

function  App() {
return (
<BurgerMenu>
    <a href="/">about</a>
    <button data-href="#contact">contact</button>
</BurgerMenu>

Props

NameTypeDefaultDescription
childrennodeCan accept any tag.
classesobjectOverride or extend the styles applied to the component. See CSS API below for more details.
onEnterfuncCallback fired before the Menu enters.
onEnteredfuncCallback fired when the Menu has entered.
onEnteringfuncCallback fired when the Menu is entering.
onExitfuncCallback fired before the Menu exits.
onExitedfuncCallback fired when the Menu has exited.
onExitingfuncCallback fired when the Menu is exiting.
onMenuItemClickfuncCallback fired when menu item was clicked. Returns item data
isOpenbooleanfalseIf true, the menu is visible.
transitionDurationobject0.4sDuration of button transition. <BurgerMenu transitionDuration={'0.3s'}> or <BurgerMenu transitionDuration={'500ms'}>
height*object27pxPass the height of the menu icon in px or pass auto to get the wrapper height. <BurgerMenu height={50}> or <BurgerMenu height={'auto'}>.
width*object35pxPass the width of the menu icon in px or pass auto to get the wrapper width. <BurgerMenu width={50}> or <BurgerMenu width={'auto'}>.
buttonBorderbooleanfalseAdd border to button. Style: solid 1px.
menuAnimationtextslideLeftMenu animation type. Available: slideLeft or fallDown .
menuBarTopnumbertop : button heightAdjust menu top position. <BurgerMenu menuBarTop={50}>

*height/width - The menu size is regulated only by one measurement height orwidth. If you pass the both props to the component the height prop will win.

CSS API

classes={{
		      buttonContainer:  "my_buttonContainer_className",
		      line: "my_line_className",
		      menuContainer: "my_menuContainer_className",
		      menuUl : "my_menuUl_className",
		      menuLi : "my_menuLi_className"
	      }}
1.0.1

4 years ago

1.0.0

4 years ago