Modern and easy to use menu component for react-router. Heavily inspired by react-metismenu
npm install --save react-light-menu
Or using yarn:
yarn add react-light-menu
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+
import React, { Component } from 'react'
import LightMenu from 'react-light-menu'
class Example extends Component {
render () {
return (
<LightMenu items={[ { title: 'Home', to: '/' } ]} />
)
}
}
- Move active items info into context
- Class names configuration
- Tests
- Move
react-router
part in separate library - Next.js router support
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
H.Alper Tuna - react-metismenu, where I took some things like DOM structure and default style
MIT © Andrey Viktorov