Nitrogen Poisonous Monoxide

    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
    

    Keywords

    none

    Install

    npm i react-priority-navigation

    DownloadsWeekly Downloads

    143

    Version

    1.0.5

    License

    MIT

    Unpacked Size

    28.9 kB

    Total Files

    23

    Last publish

    Collaborators

    • ericyip