# react-top-nav

> react-top-nav React component

Latest version **0.0.9** (published 2019-11-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-top-nav
pnpm add react-top-nav
yarn add react-top-nav
bun add react-top-nav
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.9 |
| Published | 2019-11-12 |
| First published | 2019-11-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 31.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Franklin Tarter |
| Maintainers | franklintarter |
| Keywords | react-component, top nav |

## Links

- npm: https://www.npmjs.com/package/react-top-nav
- npm.io page: https://npm.io/package/react-top-nav

## Dependencies (1)

- [styled-components](https://npm.io/package/styled-components.md) ^4.4.1

## Recent versions

- 0.0.9 (latest) — 2019-11-12
- 0.0.8 — 2019-11-11
- 0.0.7 — 2019-11-11
- 0.0.6 — 2019-11-10
- 0.0.5 — 2019-11-10
- 0.0.4 — 2019-11-10
- 0.0.3 — 2019-11-10
- 0.0.2 — 2019-11-10
- 0.0.1 — 2019-11-10

## README

# react-top-nav

Top navigation component for React

## Install

```shell
yarn add react-top-nav
```

## Use

Use in a layout component.

```js
import React from "react";
import { createTopNav } from "react-top-nav";

const { MenuIcon, Nav, MobileMenu, useMobileMenu } = createTopNav({
  mobileMenu: { backgroundColor: "#2fedf1" },
  menuIcon: { size: 48, barThickness: 2, barColor: "#0f0f0f" },
  height: 64
});


export default ({ children }) => {
  const { isOpen, isScrolled, close, open, toggle } = useMobileMenu();
  return (
    <div>
    <div style={{ paddingTop: "64px" }}>
      <Nav isScrolled={isScrolled} style={{ backgroundColor: "#ddd" }}>
        <MenuIcon onClick={toggle} isOpen={isOpen} style={{ padding: "8px" }} />
        <MobileMenu isOpen={isOpen}>
          <ul>
            <li>Item</li>
            <li>Item</li>
            <li>Item</li>
          </ul>
        </MobileMenu>
      </Nav>
      <main>{children}</main>
    </div>
  );
};

```

### Contribute

Suggestions, issues, PRs welcome!

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