• Getting Started
  • Components
  • Github
  • Go pro
energyGetting started
  • Introduction
dComponents
  • Button Components
  • Grid Components
  • Input Components
  • Layout Components
  • Toast Components
  • Widget Components
  • Alert
  • Badge
  • Breadcrumb
  • Callout
  • Card
  • Carousel
  • Charts
  • Collapse
  • CreateElement
  • DataTable
  • Dropdown
  • ElementCover
  • Embed
  • Fade
  • Form
  • Icon
  • Img
  • Jumbotron
  • Link
  • ListGroup
  • Media
  • Modal
  • Nav
  • Navbar
  • Pagination
  • Popover
  • Progress
  • Spinner
  • Switch
  • Tabs
  • Toggler
  • Tooltip

Navbar

Documentation and examples for React's powerful, responsive navigation header, the navbar. Includes support for branding, navigation, and more, including support for our collapse plugin.


Usage

Example

NavbarBrand
    HomeLink
  • Lang
    ENESRUFA
  • User
    AccountSettings

Script


  const [isOpen, setIsOpen] = useState(false);

  return (
    <div>
      <CNavbar expandable="sm" color="info" >
        <CToggler inNavbar onClick={() => setIsOpen(!isOpen)}/>
        <CNavbarBrand>
          NavbarBrand
        </CNavbarBrand>
        <CCollapse show={isOpen} navbar>
          <CNavbarNav>
            <CNavLink>Home</CNavLink>
            <CNavLink>Link</CNavLink>
          </CNavbarNav>
          <CNavbarNav className="ml-auto">
            <CForm inline>
              <CInput
                className="mr-sm-2"
                placeholder="Search"
                size="sm"
              />
              <CButton color="light" className="my-2 my-sm-0" type="submit">Search</CButton>
            </CForm>
            <CDropdown
              inNav
            >
              <CDropdownToggle color="primary">
                Lang
              </CDropdownToggle>
              <CDropdownMenu>
                <CDropdownItem>EN</CDropdownItem>
                <CDropdownItem>ES</CDropdownItem>
                <CDropdownItem>RU</CDropdownItem>
                <CDropdownItem>FA</CDropdownItem>
              </CDropdownMenu>
            </CDropdown>
            <CDropdown
              inNav
            >
              <CDropdownToggle color="primary">
                User
              </CDropdownToggle>
              <CDropdownMenu>
                <CDropdownItem>Account</CDropdownItem>
                <CDropdownItem>Settings</CDropdownItem>
              </CDropdownMenu>
            </CDropdown>
          </CNavbarNav>
        </CCollapse>
      </CNavbar>
    </div>
  )
  


# Navbar API

NameRequiredTypeDefault Value
taganynav
main HTML tag name
classNamestring
user classes for the main HTML tag
innerRef(object | Function | string)
ref to the main tag
lightboolean
switches text color to black
colorstring
background color of the component
fixed(top | bottom)
fixes navbar on top or bottom of the body, available values: 'top', 'bottom'
stickyboolean
makes navbar sticky to top of the body
expandable(boolean | string)
determines on what width navbar collapses, available values: false, true, 'sm', 'md', 'lg', 'xl'



NavbarNav


# NavbarNav API

NameRequiredTypeDefault Value
taganyul
main HTML tag name
classNamestring
user classes for the main HTML tag
innerRef(object | Function | string)
ref to the main tag



NavbarText


# NavbarText API

NameRequiredTypeDefault Value
taganydiv
main HTML tag name
childrenany
children components
classNamestring
user classes for the main HTML tag
innerRef(object | Function | string)
ref to the main tag



NavbarBrand


Render CBrand with navbar class.

  • Components
    • Usage
      • Features
      • API
    • Related
      • CNavbar
      • CNavbarNav
      • CNavbarText
      • CNavbarBrand
CoreUI © 2020 creativeLabs.core-logo