# react-priority-navigation_v2

> priority navigation component for react

Latest version **0.0.1** (published 2019-04-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-priority-navigation_v2
pnpm add react-priority-navigation_v2
yarn add react-priority-navigation_v2
bun add react-priority-navigation_v2
```

## Health

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

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2019-04-20 |
| First published | 2019-04-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 29.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 13 |
| Author | Eric Yip |
| Maintainers | codercodingthecode |

## Links

- npm: https://www.npmjs.com/package/react-priority-navigation_v2
- Repository: https://github.com/ericyip/react-priority-navigation
- Homepage: https://github.com/ericyip/react-priority-navigation#readme
- Issues: https://github.com/ericyip/react-priority-navigation/issues
- npm.io page: https://npm.io/package/react-priority-navigation_v2

## Dependencies (2)

- [lodash.debounce](https://npm.io/package/lodash.debounce.md) ^4.0.8
- [resize-observer-polyfill](https://npm.io/package/resize-observer-polyfill.md) ^1.5.1

## Recent versions

- 0.0.1 (latest) — 2019-04-20

## README

# PriorityNav for React

## Example

```js
import PriorityNav, { ToggleButton } from 'react-priority-navigation';

<PriorityNav
  icon={props => (
    <ToggleButton {...props}>
      <Icon />
    </ToggleButton>
  )}
  dropdownList={children => (
    <CustomDropdown>
      {children.map(item => <CustomItem>{item}</CustomItem>)}
    </CustomDropdown>
  )}
>
  <button>I am a Button ⏹ ️</button>
  <a>This is Link 🔗</a>
  <div>I am a Div!</div>
  <div>Looooong Div🐢🐢🐢🐢</div>
  <div>🉑</div>
</PriorityNav>;
```

## Props

| Name           | Type                                                                                  | Description                                        | Default       |
| -------------- | ------------------------------------------------------------------------------------- | -------------------------------------------------- | ------------- |
| `itemPadding`  | String                                                                                | Padding of each children                           | 'unset'       |
| `minWidth`     | String                                                                                | Min width of the nav                               | '250px'       |
| `offset`       | Number                                                                                | Extra width to trigger                             | 0             |
| `debounce`        | Number                                                                                | Debounce                                           | 0             |
| `placement`    | 'left', 'right', 'top', 'bottom', 'topLeft', 'topRight', 'bottomRight', 'bottomLeft'; | Placement of the dropdown                          | 'bottomRight' |
| `isOpen`       | Boolean                                                                               | Dropdown open state                                | false         |
| `icon`         | (props: IconSetting) => React.ReactElement<HTMLElement>                               | Use this to render custom Icon with `ToggleButton` | null          |
| `dropdownList` | (item: Array<React.ReactNode>) => React.ReactElement<HTMLElement>                     | custom dropdown, take children as props            | null          |

### ToggleButton

```
  color?: string;
  size?: number;
  hoverColor?: string;
  children?: React.ReactNode
```

### IconSetting

```
  color: string;
  size: number;
  hoverColor: string;
```

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