react-priority-navigation
TypeScript icon, indicating that this package has built-in type declarations

1.0.5 • Public • Published

PriorityNav for React

Example

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

<PriorityNav
  dropdown={({ dropdownItems, buttonProps }) => (
    <>
      <ToggleButton {...buttonProps.bind} />
      <PopupContent>
        {dropdownItems.map((item, i) => (
          <CustomItem key={i} {...item.props} />
        ))}
      </PopupContent>
    </>
  )}
>
  <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
isOpen Boolean Dropdown open state false

ToggleButton

  children?: React.ReactNode

Dependencies (3)

Dev Dependencies (35)

Package Sidebar

Install

npm i react-priority-navigation

Weekly Downloads

1,235

Version

1.0.5

License

MIT

Unpacked Size

28.9 kB

Total Files

23

Last publish

Collaborators

  • ericyip