Minimal side navigation component for React
npm install react-minimal-side-navigation
❤️ it? ⭐️ it on GitHub or Tweet about it.

- Demo
- Installation
- Usage
- API
- Issues
- 🐛 Bugs
- LICENSE
> https://codesandbox.io/s/react-minimal-side-navigation-example-y299d
Ensure you have Node.js 10 or later installed. Then run the following:
``via npm
npm install react-minimal-side-navigation
Usage
`js
import React from 'react';import {Navigation} from 'react-minimal-side-navigation';
import 'react-minimal-side-navigation/lib/ReactMinimalSideNavigation.css';
function App() {
return (
<>
// you can use your own router's api to get pathname
activeItemId="/management/members"
onSelect={({itemId}) => {
// maybe push to the route
}}
items={[
{
title: 'Dashboard',
itemId: '/dashboard',
// you can use your own custom Icon component as well
// icon is optional
elemBefore: () => ,
},
{
title: 'Management',
itemId: '/management',
elemBefore: () => ,
subNav: [
{
title: 'Projects',
itemId: '/management/projects',
// Requires v1.9.1+ (https://github.com/abhijithvijayan/react-minimal-side-navigation/issues/13)
elemBefore: () => ,
},
{
title: 'Members',
itemId: '/management/members',
elemBefore: () => ,
},
],
},
{
title: 'Another Item',
itemId: '/another',
subNav: [
{
title: 'Teams',
itemId: '/management/teams',
},
],
},
]}
/>
>
);
}
`API
#### items
Type:
arrayNavigation items to render.
#### activeItemId
Type:
stringCurrently selected item id.
#### onSelect
Type:
functionCalled when item is clicked.
Issues
_Looking to contribute? Look for the Good First Issue
label._
$3
Please file an issue here for bugs, missing documentation, or unexpected behavior.
$3
@abhijithvijayan/eslint-config
- Shared TypeScript Configuration - @abhijithvijayan/tsconfig`MIT © Abhijith Vijayan