3.4.0 • Published 5 years ago

@opuscapita/react-responsive-navbar v3.4.0

Weekly downloads
183
License
MIT
Repository
github
Last release
5 years ago

react-responsive-navbar

Description

Navbar component that moves the navbar items to a dropdown, if they do not fit in the content area.

Installation

npm install @opuscapita/react-responsive-navbar

Demo

View the DEMO

Builds

UMD

The default build with compiled styles in the .js file. Also minified version available in the lib/umd directory.

CommonJS/ES Module

You need to configure your module loader to use cjs or es fields of the package.json to use these module types. Also you need to configure sass loader, since all the styles are in sass format.

API

Prop nameTypeDefaultDescription
idstring'responsive-navbar'Custom ID prefix
classNamestringCuston className
activeKeynumberobjectrequiredNavbar item to be active initially
listarray of object (name, href)requiredList of navbar items
showNavItemBorderbooleanfalseshow bottom-border below navbar items
showNavItemTooltipbooleantrueenables tooltips for nav items
tooltipDelaynumber2000delay before tooltip becomes visible
fontSizestring'inherit'override for fontSize
fontWeightstring'inherit'override for fontWeight
placeholderstring'more...'override for placeholder text
heightstring40pxoverride for height
heightstring40pxoverride for height
onSelectfunctionCallback fired when the active item changes
componentLeftnodeCustom component aligned to left
componentRightnodeCustom component aligned to right

Code example

import ResponsiveNavbar from '@opuscapita/react-responsive-navbar';

const ResponsiveNavbarView = (props) => {
  const list = [
    { name: 'Item 1', href: '/item1' },
    { name: 'Item 2', href: '/item2' },
  ];

  const activeKey = 2;

  return (
    <ResponsiveNavbar
      activeKey={activeKey}
      list={list}
      onSelect={(href) => { props.router.push(href); }}
    />
  );
};

export default withRouter(ResponsiveNavbarView);
3.4.0

5 years ago

3.3.4

5 years ago

3.3.3

5 years ago

3.3.2

5 years ago

3.3.1

5 years ago

3.3.0

5 years ago

3.2.2

5 years ago

3.2.1

5 years ago

3.1.8

5 years ago

3.1.7

6 years ago

3.1.6

6 years ago

3.0.6

6 years ago

3.0.5

6 years ago

3.0.4

6 years ago

3.0.3

6 years ago

3.0.2

6 years ago

3.0.1

6 years ago

3.0.0

6 years ago

2.0.1

6 years ago

2.0.0

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago