reactstrap-json-nav
v1.0.3
Published
Turn JSON into a bootstrap nav
Downloads
60
Readme
Turn JSON into a reactstrap JSON Nav
Install
npm i reactstrap-json-nav
Usage
import Navigation from 'reactstrap-json-nav'
let json = [
{name: 'Components', url: '/components/'},
{name: 'GitHub', url: 'https://github.com/reactstrap/reactstrap'}
]
export default () => (
<Navigation json={json}/>
)
Output
export default ({}) => (
<Nav className="ml-auto" navbar>
<NavItem>
<NavLink href="/components/">Components</NavLink>
</NavItem>
<NavItem>
<NavLink href="https://github.com/reactstrap/reactstrap">GitHub</NavLink>
</NavItem>
</Nav>
)
Props
- json (Required) - Array of json hashes
- link (optional) - replacement Link component
- className (optional) - applied to outer Nav
- ...options passed to link component
Development
- Edit src/index.js
- Run
npm run build
- Submit pull-request