Navbar

A navigation bar (or navigation system) is a section of a graphical user interface intended to aid visitors in accessing information.

Preview

Usage

The navbar uses a custom hook useSidebar for the side menu on mobile devices.

Customization With Props

  • navList -> Accepts an array, where each element is an object of the structure:

NOTE: Keep the name of the keys same as above.

  • statesObj -> Used to show/hide various parts of Navbar, accepts an object of the structure:

NOTE: Keep the keys of the object same as above.

  • onClickFunction -> Accepts a function, written by the user, for handling on Click logic on button.

  • buttonText -> Accepts a string/node value, used as the button name.

  • logoImgSrc -> Accepts a string value, the image source link used as logo in Navbar.

  • logoName -> Accepts a string/node value, used as the text beside the logo image.

  • id -> The id prop is similar to the id attribute in HTML. It allows to provide overall component id.

  • imgLoad -> The imgLoad prop is mapped to the loading attribute in HTML img tag. It allows to provide overall the value for loading attribute, "lazy" | "eager".

  • userHeaderStyle -> Accepts the class name(s) as string, custom styling prop for the full navbar container.

  • userNavListStyle -> Accepts the class name(s) as string, custom styling prop for container for list items shown.

  • userNavListItemStyle -> Accepts the class name(s) as string, custom styling prop for each list item inside the list container.

  • userLogoStyle -> Accepts the class name(s) as string, custom styling prop for the container having the logo image and logo text.

  • userSideBarStyle -> Accepts the class name(s) as string, custom styling prop for the sidebar shown only on mobile devices.

  • userButtonStyle -> Accepts the class names(s) as string, custom styling prop for the button.

  • userNavButtonSvgColor -> Accepts class name as string, mainly the fill color property to change the color of menu button shown on mobile devices.

Component Code

This is the code for the Navbar component.

Last updated