# react-rug-menu

> A responsive menu for React that will hide anything that doesn't fit 'under the rug'

Latest version **2.0.2** (published 2019-12-06) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install react-rug-menu
pnpm add react-rug-menu
yarn add react-rug-menu
bun add react-rug-menu
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 2.0.2 |
| Published | 2019-12-06 |
| First published | 2016-05-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.10.0 |
| Dependencies | 0 |
| Unpacked size | 5.5 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Nacho Coloma |
| Maintainers | icoloma |
| Keywords | react, responsive, menu, OkayNav |

## Links

- npm: https://www.npmjs.com/package/react-rug-menu
- Repository: https://github.com/koliseoapi/react-rug-menu
- Issues: https://github.com/koliseoapi/react-rug-menu/issues
- npm.io page: https://npm.io/package/react-rug-menu

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 2.0.2 (latest) — 2019-12-06
- 2.0.1 — 2019-12-06
- 2.0.0 — 2019-12-05
- 1.3.0 — 2018-09-11
- 1.2.1 — 2018-09-06
- 1.2.0 — 2018-01-30
- 1.1.1 — 2017-12-13
- 1.1.0 — 2017-06-30
- 1.0.8 — 2016-08-09
- 1.0.7 — 2016-07-30
- 1.0.6 — 2016-06-26
- 1.0.5 — 2016-06-26
- 1.0.4 — 2016-06-26
- 1.0.3 — 2016-06-05
- 1.0.2 — 2016-05-03
- … 2 more at https://npm.io/package/react-rug-menu/versions

## README

# React Rug Menu

This responsive menu will hide any options that don't fit in the screen into
a popup menu ("under the rug"). It also works while resizing the window.

<a href="http://koliseoapi.github.io/react-rug-menu/">
<img src="http://koliseoapi.github.io/react-rug-menu/Screencast.mp4.gif" title="Click to go to the demo page">
</a>

Inspired in [OkayNav](https://github.com/VPenkov/okayNav), but developed for
React and React Router. The module itself is tiny (below 200 lines).

## Use

Use `MenuItem` as if it were a `Link` tag, and nest all items inside of `Menu`.

```
import { Menu, MenuItem } from "../lib/main";
import { Router, Route, hashHistory } from "react-router";
import ReactDOM from "react-dom";
import React from "react";

let MyAppComponent = React.createClass({

  render: function() {
    return (
      <div>
        <Menu>
          <MenuItem className="menu-item" to="events">Events</MenuItem>
          <MenuItem className="menu-item" to="books">Books</MenuItem>
          <MenuItem className="menu-item" to="go">Go</MenuItem>
          <MenuItem className="menu-item" to="cars">Cars</MenuItem>
        </Menu>
        { this.props.children }
      </div>
    )
  }

})

ReactDOM.render(
  <Router history={hashHistory}>
    <Route path="/" component={MyAppComponent}>
      <Route name="events" path="events" component={ eventComponent } />
      <Route name="books" path="books" component={ bookComponent } />
      <Route name="go" path="go" component={ goComponent } />
      <Route name="cars" path="cars" component={ carComponent } />
    </Route>
  </Router>,
  document.getElementsByClassName('test-container')[0]
);
```

## Accessibility

ARIA roles are automatically generated so that a screen reader will read all the menu items like any normal navigation menu.

## Develop

```bash
npm i

npm run build

npm run watch
```

There is no `build` step. The library is a single file in `lib/main.js` and published as is.

---
_Source: https://npm.io/package/react-rug-menu · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
