Skip to content

Repository files navigation

React Slide Menu

Build StatusDependenciesDev Dependencies

npm download

Demo

Slide menu demo

Install the package

Use NPM or Yarn

yarn add react-slide-menu
npm install --save react-slide-menu

Usage

1 . Require react-atmosphere-menu after installation

importSlideMenufrom'react-slide-menu'

2 . Wrap react-slide-menu around your app

<SlideMenu><YOURAPP/></SlideMenu>

3 . Customize options

varnav=[{id: 'home',label: 'Home',path: '/'},{id: 'about',label: 'About',path: '/about'},{id: 'discover',label: 'Discover',path: '/discover'},]<SlideMenuactive={this.state.slideMenuActive}nav={nav}reactRouter={true}closeMenu={()=>this.setState({slideMenuActive: false})}><YOUR_APP/></SlideMenu>

Main Options

OptionTypeDescription
activeBooleantrue will show the menu and false will hide the menu. (Required)
navArrayAn array of objects that describe the navigation menu. Each object needs to have keys id, label, and path. (Required)
reactRouterBooleantrue if you use React Router in your project false if you don't.
extraComponentTopComponentDisplayed before the Nav you can add anything you want, add a component for a logo or something else like so: <img src={LOGO} />.
extraComponentBottomComponentDisplayed after the Nav you can add anything you want, add a component for a logo or something else like so: <img src={LOGO} />.
closeMenuFunctionThe function that closes your atmosphere menu. Should set the variable for the active prop to false.

Extra Options / Styling options

OptionTypeDescription
menuClassNameStringExtra class to style the AtmosphereMenu component. Default: menu: { position: 'relative', overflow: 'hidden', },
appClassNameStringExtra class to style your app when the menu is active.
companyClassNameStringExtra class to style the companyName text.
navItemClassNameStringExtra class to style each Navigation item. Default: navItem: { marginBottom: '25px', opacity: '.7', ':hover': { opacity: '1',}},
navLinkStyleStringExtra prop to style the <a> or Link element of each Navigation Item. Default: linkStyle: { textDecoration: 'none', color: '#fff', fontWeight: '300', '@media only screen and (min-width: 768px)': { fontSize: '2em', }, '@media only screen and (min-width: 1440px)': { fontSize: '2.5em', }},
linkClassNameStringExtra class to style the <a> or Link element of each Navigation item. Has the same style default as above navLinkStyle.
navClassNameStringExtra class to style the whole Nav component.

Inspired by

www.youtube.com

and

www.typeform.com

About

A React.js menu that slides your app in & out

Resources

Stars

8 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages