react-light-menu

Modern and easy to use menu component for react-router. Heavily inspired by react-metismenu

Usage no npm install needed!

<script type="module">
  import reactLightMenu from 'https://cdn.skypack.dev/react-light-menu';
</script>

README

react-light-menu

Modern and easy to use menu component for react-router. Heavily inspired by react-metismenu

NPM JavaScript Style Guide

Demo

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