0.0.3 • Published 3 years ago

rjs-navbar v0.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

About

rjs-navbar is a navigational header component for react web apps.

Getting Started

Install with npm: npm i rjs-navbar Install with yarn yarn add rjs-navbar

Include in your project

import Navbar from 'rjs-navbar/Navbar';
<Navbar
 logo={<img src="http://mrmrs.github.io/photos/u/011.jpg" style={{width:'100%',height:'100%'}}/>}
 activeLabel={(val) => setGoto(val)}
 searchQuery={(val) => setGoto(val)}
 left={"search"}
 center={["item 1", "item2","item 1", "item2"]}
 right={"logo"}
 search={true}
 foreGroundStyle={{color:'white',padding:3,border:'1px solid white',width:'100%', margin:2,fontSize:17, fontWeight:'bold'}}
 backGroundStyle={{background:'linear-gradient(to right, rgb(0, 0, 255), rgb(255, 0, 0))',opacity:0.9}}
 searchStyle={{border:'1px solid green', width:200, height:30}}
/>

Props

PropsDetailsExamples
logocan be a string or a react component<img src="http://mrmrs.github.io/photos/u/011.jpg"style={{width:'100%',height:'100%'}}/>
activeLabelreturns the selected label{(val) => setGoto(val)}
searchQueryreturns the search query{(val) => setGoto(val)}
leftleft side component of navbar can be on of : "search","logo" or and array of labels"item 1", "item 2" , "logo"
centercenter component of navbar can be on of : "search","logo" or and array of labels"item 1", "item 2" , "logo"
rightright side component of navbar can be on of : "search","logo" or and array of labels"item 1", "item 2" , "logo"
searchsets the search input, can be true or falsesearch={true}
foreGroundobject containg styles for the foreground{color:'white',padding:3,border:'1px solid white',width:'100%', margin:2,fontSize:17, fontWeight:'bold'}
backGroundStyleobject containing styles for the background{background:'linear-gradient(to right, rgb(0, 0, 255), rgb(255, 0, 0))',opacity:0.9}
searchStyleobject containing styles for the search input box{border:'1px solid green', width:200, height:30}

Examples