Skip to content

Repository files navigation

React Atmosphere Menu

Build StatusDependenciesDev Dependencies

npm download

Demo

Alt Text

Install the package

Use NPM or Yarn

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

Usage

1 . Require react-atmosphere-menu after installation

importAtmosphereMenufrom'react-atmosphere-menu'

2 . Wrap react-atmosphere-menu around your app

<AtmosphereMenu><YOURAPP/>
</AtmosphereMenu

3 . Customize options

varnav=[{id: 'home',label: 'Home',path: '/'},{id: 'about',label: 'About',path: '/about'},{id: 'discover',label: 'Discover',path: '/discover'},]<AtmosphereMenuactive={this.state.atmosphereActive}nav={nav}reactRouter={true}tagLine={"Made by"}companyName={"Q5"}closeMenu={()=>this.setState({atmosphereActive: false})}><YOURAPP/></AtmosphereMenu

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.
tagLineStringBelow the navigation, there will be an area for extra text. The tagline goes above the company text.
companyNameStringBelow the navigation, there will be an area for extra text. Here you can display your name or company or group.
logoComponentComponentDisplayed in line with the companyName, add a component for a logo like so: <img src={LOGO} />.
closeMenuFunctionThe function that closes your atmosphere menu. Should set the variable for the active prop to false.
backgroundImageImage / StringAn image you want to display in the background on the active Menu or a color. It can be a link to an image online, a file, or #eee.

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.atmospherejs.com

About

A React.js menu that pulls out and scales your app down

Resources

Stars

5 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages