You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At this point you can import @trendmicro/react-sidenav and its styles in your application as follows:
importSideNav,{Toggle,Nav,NavItem,NavIcon,NavText}from'@trendmicro/react-sidenav';// Be sure to include styles at some point, probably during your bootstrapingimport'@trendmicro/react-sidenav/dist/react-sidenav.css';
Usage
These examples make use of font-awesome.
<SideNavonSelect={(selected)=>{// Add your code here}}><SideNav.Toggle/><SideNav.NavdefaultSelected="home"><NavItemeventKey="home"><NavIcon><iclassName="fa fa-fw fa-home"style={{fontSize: '1.75em'}}/></NavIcon><NavText>
Home
</NavText></NavItem><NavItemeventKey="charts"><NavIcon><iclassName="fa fa-fw fa-line-chart"style={{fontSize: '1.75em'}}/></NavIcon><NavText>
Charts
</NavText><NavItemeventKey="charts/linechart"><NavText>
Line Chart
</NavText></NavItem><NavItemeventKey="charts/barchart"><NavText>
Bar Chart
</NavText></NavItem></NavItem></SideNav.Nav></SideNav>
React Router v4 with React v16
<Router><Routerender={({ location, history })=>(<React.Fragment><SideNavonSelect={(selected)=>{constto='/'+selected;if(location.pathname!==to){history.push(to);}}}><SideNav.Toggle/><SideNav.NavdefaultSelected="home"><NavItemeventKey="home"><NavIcon><iclassName="fa fa-fw fa-home"style={{fontSize: '1.75em'}}/></NavIcon><NavText>
Home
</NavText></NavItem><NavItemeventKey="devices"><NavIcon><iclassName="fa fa-fw fa-device"style={{fontSize: '1.75em'}}/></NavIcon><NavText>
Devices
</NavText></NavItem></SideNav.Nav></SideNav><main><Routepath="/"exactcomponent={props=><RootComponent/>}/><Routepath="/home"component={props=><Home/>}/><Routepath="/devices"component={props=><Devices/>}/></main></React.Fragment>)}/></Router>
Close the side navigation menu when clicking outside