Skip to main content

Components

Navigation Bar

A responsive navigation header positioned on top side of your page that includes support for branding, links, navigation, collapse and more.

banner-Navigation Bar
Square Icon

Selected Theme

Select brand or tribe name to preview style

Default

Usage

Navigation bar is a menu that contains structured links and functions to direct the user to another page from the page that is being displayed.

use of components don’t forget to add import legion-ui

import { Navbar, NavbarBrand, NavbarCollapse, NavbarContent, NavbarItem, NavbarToggle } from 'legion-ui';

Variant

Legion Have 4 variant of Navigation Bar:

Basic Navigation Bar

you can add Button component in navigation or other components

const NavigationLogin = () => {
const [activeToggle, setActiveToggle] = useState(false);
return (
<Navbar variant="sticky" mode="light">
<NavbarBrand style={{ display: 'flex', alignItem: 'center' }}>
<Heading size="h3" color="primary500">
Legion
</Heading>

this navigation bar with added menu

const NavigationMenu = () => {
const [activeToggle, setActiveToggle] = useState(false);
return (
<Navbar variant="sticky" mode="light">
<NavbarBrand style={{ display: 'flex', alignItem: 'center' }}>
<Heading size="h3" color="primary500">
Legion
</Heading>

this navigation bar added searchcomponent

const NavigationSearch = () => {
const [activeToggle, setActiveToggle] = useState(false);
return (
<Navbar variant="sticky" mode="light">
<NavbarBrand style={{ display: 'flex', alignItem: 'center' }}>
<Heading size="h3" color="primary500">
Legion
</Heading>

this navigation bar added icon, search and avatar

const NavigationAvatar = () => {
const [activeToggle, setActiveToggle] = useState(false);
return (
<Navbar variant="sticky" mode="light">
<NavbarBrand style={{ display: 'flex', alignItem: 'center' }}>
<Heading size="h3" color="primary500">
Legion
</Heading>

Props

Main Navbar, the very outer wrapper

propertypropTyperequireddefaultdescription
childrenReact.ReactNode--Pass all the necessary components here
isBorderedboolean-falseMakes the navbar have border around it (only avail in floating variant)
isCompactboolean-falseMakes the navbar have no vertical (top and bottom) gap
modelight | dark-lightSets the navbar background mode
variantstatic | floating | sticky-staticSets the navbar position

Wraps the left side of the Navbar, wrap your logo inside here

propertypropTyperequireddefaultdescription
childrenReact.ReactNode--Pass all the necessary components here

Wrapper to hold the mobile/tablet navigation of your App, you can ignore this if you don’t need responsive menu

propertypropTyperequireddefaultdescription
childrenReact.ReactNode--Pass all the necessary components here
isActiveboolean-falseWill show when isActive value is true, trigger it with React’s state in your App

Wraps usually the mid and right side of the Navbar, wrap your contents such as menu, buttons, search inputs, avatar, around here.

propertypropTyperequireddefaultdescription
childrenReact.ReactNode--Pass all the necessary components here
hideInsm | md | lg | xl-mdMake sure to hide the contents when it reached the given hideIn value

List of childs of your menu after being wrapped inside NavbarContent

propertypropTyperequireddefaultdescription
childrenReact.ReactNode--Pass all the necessary components here
hrefstring--Routing address you desire to fill in
isActiveboolean-falseWill get highlighted if value is true, useful usually combined with routing to indicate in which route are we

A menu button to click, to trigger the NavbarCollapse activation.

propertypropTyperequireddefaultdescription
onClickReact.MouseEventHandler--onClick trigger, make it a setState function to change the boolean value to trigger NavbarCollapse’s show/hide
showInsm | md | lg | xl-mdMake sure to show the toggle when it reached the given showIn value