react-light-menu
v1.0.1
Published
Modern and easy to use menu component for react-router
Downloads
1
Readme
react-light-menu
Modern and easy to use menu component for react-router. Heavily inspired by react-metismenu
Install
npm install --save react-light-menu
Or using yarn:
yarn add react-light-menu
Requirements
Because light-menu written completely using hooks, which is a feature of never react and react-router, here's some requirements:
React v16.8.0+
React Router v5.1.0+
Usage
import React, { Component } from 'react'
import LightMenu from 'react-light-menu'
class Example extends Component {
render () {
return (
<LightMenu items={[ { title: 'Home', to: '/' } ]} />
)
}
}
TODO
- Move active items info into context
- Class names configuration
- Tests
- Move
react-router
part in separate library - Next.js router support
Development
To run examples locally, you will need to npm link
react in example
folder, otherwise everything will fail:
cd example
npm link ../node_modules/react
Thanks
H.Alper Tuna - react-metismenu, where I took some things like DOM structure and default style
License
MIT © Andrey Viktorov