CoreUI for Vue.js logo
Angular JavaScript / Vanilla JS React.js
  • undefinedGetting started
  • undefinedCustomize
  • undefinedLayout
  • undefinedForms
  • undefinedComponents
  • undefinedTemplates
  • undefinedMigration
  • undefined
  • undefined
  • undefined
undefinedDownloadundefinedHire Us Get CoreUI PRO

Support CoreUI Development

CoreUI is an MIT-licensed open source project and is completely free to use. However, the amount of effort needed to maintain and develop new features for the project is not sustainable without proper financial backing.

You can support our Open Source software development in the following ways:

  • Buy the CoreUI PRO, and get access to PRO components, and dedicated support.
  • Hire Us! We create stunning designs, high-conversion landing pages, functional mobile apps and reliable web services – everything you need to offer your products or services online and always stay a tap away from your customers.
  • Give us a star ⭐️ on Github.

Vue Navbar Component

Documentation and examples for the Vue navbar powerful, responsive navigation header component. Includes support for branding, links, dropdowns, and more.

Other frameworks

CoreUI components are available as native Angular, Bootstrap (Vanilla JS), and React components. To learn more please visit the following pages.

  • Bootstrap Navbar
  • React Navbar

Supported content #

<CNavbar> come with built-in support for a handful of sub-components. Choose from the following as needed:

  • <CNavbarBrand> for your company, product, or project name.
  • <CNavbarNav> for a full-height and lightweight navigation (including support for dropdowns).
  • <CNavbarToggler> for use with our collapse plugin and other navigation toggling behaviors.
  • Flex and spacing utilities for any form controls and actions.
  • <CNavbarText> for adding vertically centered strings of text.
  • <CCollapse> for grouping and hiding navbar contents by a parent breakpoint.

Here's an example of all the sub-components included in a responsive light-themed navbar that automatically collapses at the lg (large) breakpoint.

Basic usage #

Navbar
  • Home
  • Link
  • Dropdown button
    ActionAnother action
    Something else here
  • Disabled
<CNavbar expand="lg" color-scheme="light" class="bg-light">
  <CContainer fluid>
    <CNavbarBrand href="#">Navbar</CNavbarBrand>
    <CNavbarToggler @click="visible = !visible"/>
    <CCollapse class="navbar-collapse" :visible="visible">
      <CNavbarNav>
        <CNavItem>
          <CNavLink href="#" active>
            Home
          </CNavLink>
        </CNavItem>
        <CNavItem>
          <CNavLink href="#">Link</CNavLink>
        </CNavItem>
        <CDropdown variant="nav-item" :popper="false">
          <CDropdownToggle color="secondary">Dropdown button</CDropdownToggle>
          <CDropdownMenu>
            <CDropdownItem href="#">Action</CDropdownItem>
            <CDropdownItem href="#">Another action</CDropdownItem>
            <CDropdownDivider />
            <CDropdownItem href="#">Something else here</CDropdownItem>
          </CDropdownMenu>
        </CDropdown>
        <CNavItem>
          <CNavLink href="#" disabled>
            Disabled
          </CNavLink>
        </CNavItem>
      </CNavbarNav>
      <CForm class="d-flex">
        <CFormInput type="search" class="me-2" placeholder="Search"/>
        <CButton type="submit" color="success" variant="outline">Search</CButton>
      </CForm>
    </CCollapse>
  </CContainer>
</CNavbar>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36

Brand #

The <CNavbarBrand> can be applied to most elements, but an anchor works best, as some elements might require utility classes or custom styles.

Navbar

Navbar
// As a link
<CNavbar color-scheme="light" class="bg-light">
  <CContainer fluid>
    <CNavbarBrand href="#">Navbar</CNavbarBrand>
  </CContainer>
</CNavbar>
<br/>
// As a heading
<CNavbar color-scheme="light" class="bg-light">
  <CContainer fluid>
    <CNavbarBrand class="mb-0 h1">Navbar</CNavbarBrand>
  </CContainer>
</CNavbar>
1
2
3
4
5
6
7
8
9
10
11
12
13

Adding images to the <CNavbarBrand> will likely always require custom styles or utilities to properly size. Here are some examples to demonstrate.

// Just an image
<CNavbar color-scheme="light" class="bg-light">
  <CContainer fluid>
    <CNavbarBrand href="#">
      <img src="/images/brand/coreui-signet.svg" alt="" width="22" height="24"/>
    </CNavbarBrand>
  </CContainer>
</CNavbar>
1
2
3
4
5
6
7
8
CoreUI
// Image and text
<CNavbar color-scheme="light" class="bg-light">
  <CContainer fluid>
    <CNavbarBrand href="#">
      <img src="/images/brand/coreui-signet.svg" alt="" width="22" height="24" class="d-inline-block align-top"/> CoreUI
    </CNavbarBrand>
  </CContainer>
</CNavbar>
1
2
3
4
5
6
7
8

Nav #

<CNavbar> navigation is based on <CNavbarNav>. Navigation in navbars will also grow to occupy as much horizontal space as possible to keep your navbar contents securely aligned.

Navbar
  • Home
  • Features
  • Pricing
  • Disabled
<CNavbar expand="lg" color-scheme="light" class="bg-light">
  <CContainer fluid>
    <CNavbarBrand href="#">Navbar</CNavbarBrand>
    <CNavbarToggler aria-label="Toggle navigation" aria-expanded={visible} @click="visible = !visible"/>
    <CCollapse class="navbar-collapse" :visible="visible">
      <CNavbarNav>
        <CNavItem>
          <CNavLink href="#" active>
            Home
          </CNavLink>
        </CNavItem>
        <CNavItem>
          <CNavLink href="#">Features</CNavLink>
        </CNavItem>
        <CNavItem>
          <CNavLink href="#">Pricing</CNavLink>
        </CNavItem>
        <CNavItem>
          <CNavLink href="#" disabled>Disabled</CNavLink>
        </CNavItem>
      </CNavbarNav>
    </CCollapse>
  </CContainer>
</CNavbar>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24

And because we use classes for our navs, you can avoid the list-based approach entirely if you like.

Navbar
Home FeaturesPricingDisabled
<CNavbar expand="lg" color-scheme="light" class="bg-light">
  <CContainer fluid>
    <CNavbarBrand href="#">Navbar</CNavbarBrand>
    <CNavbarToggler aria-label="Toggle navigation" aria-expanded={visible} @click="visible = !visible"/>
    <CCollapse class="navbar-collapse" :visible="visible">
      <CNavbarNav component="nav">
        <CNavLink href="#" active>
            Home
          </CNavLink>
        <CNavLink href="#">Features</CNavLink>
        <CNavLink href="#">Pricing</CNavLink>
        <CNavLink href="#" disabled>Disabled</CNavLink>
      </CNavbarNav>
    </CCollapse>
  </CContainer>
</CNavbar>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

You can also use dropdowns in your navbar. Please note that <CDropdown> component requires variant="nav-item".

Navbar
  • Home
  • Features
  • Pricing
  • Dropdown link
    ActionAnother action
    Something else here
<CNavbar expand="lg" color-scheme="light" class="bg-light">
  <CContainer fluid>
    <CNavbarBrand href="#">Navbar</CNavbarBrand>
    <CNavbarToggler aria-label="Toggle navigation" aria-expanded={visible} @click="visible = !visible"/>
    <CCollapse class="navbar-collapse" :visible="visible">
      <CNavbarNav>
        <CNavItem>
          <CNavLink href="#" active>
            Home
          </CNavLink>
        </CNavItem>
        <CNavItem>
          <CNavLink href="#">Features</CNavLink>
        </CNavItem>
        <CNavItem>
          <CNavLink href="#">Pricing</CNavLink>
        </CNavItem>
        <CDropdown variant="nav-item" :popper="false">
          <CDropdownToggle>Dropdown link</CDropdownToggle>
          <CDropdownMenu>
            <CDropdownItem href="#">Action</CDropdownItem>
            <CDropdownItem href="#">Another action</CDropdownItem>
            <CDropdownDivider />
            <CDropdownItem href="#">Something else here</CDropdownItem>
          </CDropdownMenu>
        </CDropdown>
      </CNavbarNav>
    </CCollapse>
  </CContainer>
</CNavbar>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30

Forms #

Place various form controls and components within a navbar:

<CNavbar color-scheme="light" class="bg-light">
  <CContainer fluid>
    <CForm class="d-flex">
      <CFormInput type="search" class="me-2" placeholder="Search"/>
      <CButton type="submit" color="success" variant="outline">Search</CButton>
    </CForm>
  </CContainer>
</CNavbar>
1
2
3
4
5
6
7
8

Immediate child elements of <CNavbar> use flex layout and will default to justify-content: space-between. Use additional flex utilities as needed to adjust this behavior.

Navbar
<CNavbar color-scheme="light" class="bg-light">
  <CContainer fluid>
    <CNavbarBrand href="#">Navbar</CNavbarBrand>
    <CForm class="d-flex">
      <CFormInput type="search" class="me-2" placeholder="Search"/>
      <CButton type="submit" color="success" variant="outline">Search</CButton>
    </CForm>
  </CContainer>
</CNavbar>
1
2
3
4
5
6
7
8
9

Input groups work, too. If your navbar is an entire form, or mostly a form, you can use the <CForm> element as the container and save some HTML.

@
<CNavbar color-scheme="light" class="bg-light">
  <CForm class="container-fluid">
    <CInputGroup>
      <CInputGroupText id="basic-addon1">@</CInputGroupText>
      <CFormInput placeholder="Username" aria-label="Username" aria-describedby="basic-addon1"/> 
    </CInputGroup>
  </CForm>
</CNavbar>
1
2
3
4
5
6
7
8

Various buttons are supported as part of these navbar forms, too. This is also a great reminder that vertical alignment utilities can be used to align different sized elements.

<CNavbar color-scheme="light" class="bg-light">
  <CForm class="container-fluid justify-content-start">
    <CButton type="button" color="success" variant="outline" class="me-2">Main button</CButton>
    <CButton type="button" color="secondary" variant="outline" size="sm">Smaller button</CButton>
  </CForm>
</CNavbar>
1
2
3
4
5
6

Text #

Navbars may contain bits of text with the help of <CNavbarText>. This class adjusts vertical alignment and horizontal spacing for strings of text.

Navbar text with an inline element
<CNavbar color-scheme="light" class="bg-light">
  <CContainer fluid>
    <CNavbarText>Navbar text with an inline element</CNavbarText>
  </CContainer>
</CNavbar>
1
2
3
4
5

Color schemes #

Theming the navbar has never been easier thanks to the combination of theming classes and background-color utilities. Set color-scheme="light" for use with light background colors, or color-scheme="dark" for dark background colors. Then, customize with .bg-* utilities.

Navbar
  • Home
  • Link
  • Dropdown button
    ActionAnother action
    Something else here
  • Disabled

Navbar
  • Home
  • Link
  • Dropdown button
    ActionAnother action
    Something else here
  • Disabled

Navbar
  • Home
  • Link
  • Dropdown button
    ActionAnother action
    Something else here
  • Disabled
<CNavbar expand="lg" color-scheme="dark" class="bg-dark">
  <CContainer fluid>
    <CNavbarBrand href="#">Navbar</CNavbarBrand>
    <CNavbarToggler aria-label="Toggle navigation" aria-expanded={visible} @click="visible = !visible"/>
    <CCollapse class="navbar-collapse" :visible="visible">
      <CNavbarNav>
        <CNavItem>
          <CNavLink href="#" active>
            Home
          </CNavLink>
        </CNavItem>
        <CNavItem>
          <CNavLink href="#">Link</CNavLink>
        </CNavItem>
        <CDropdown variant="nav-item" :popper="false">
          <CDropdownToggle color="secondary">Dropdown button</CDropdownToggle>
          <CDropdownMenu>
            <CDropdownItem href="#">Action</CDropdownItem>
            <CDropdownItem href="#">Another action</CDropdownItem>
            <CDropdownDivider />
            <CDropdownItem href="#">Something else here</CDropdownItem>
          </CDropdownMenu>
        </CDropdown>
        <CNavItem>
          <CNavLink href="#" disabled>
            Disabled
          </CNavLink>
        </CNavItem>
      </CNavbarNav>
      <CForm class="d-flex">
        <CFormInput type="search" class="me-2" placeholder="Search"/>
        <CButton type="submit" color="light" variant="outline">Search</CButton>
      </CForm>
    </CCollapse>
  </CContainer>
</CNavbar>
<br/>
<CNavbar expand="lg" color-scheme="dark" class="bg-primary">
  <CContainer fluid>
    <CNavbarBrand href="#">Navbar</CNavbarBrand>
    <CNavbarToggler aria-label="Toggle navigation" aria-expanded={visible} @click="visible = !visible"/>
    <CCollapse class="navbar-collapse" :visible="visible">
      <CNavbarNav>
        <CNavItem>
          <CNavLink href="#" active>
            Home
          </CNavLink>
        </CNavItem>
        <CNavItem>
          <CNavLink href="#">Link</CNavLink>
        </CNavItem>
        <CDropdown variant="nav-item" :popper="false">
          <CDropdownToggle color="secondary">Dropdown button</CDropdownToggle>
          <CDropdownMenu>
            <CDropdownItem href="#">Action</CDropdownItem>
            <CDropdownItem href="#">Another action</CDropdownItem>
            <CDropdownDivider />
            <CDropdownItem href="#">Something else here</CDropdownItem>
          </CDropdownMenu>
        </CDropdown>
        <CNavItem>
          <CNavLink href="#" disabled>
            Disabled
          </CNavLink>
        </CNavItem>
      </CNavbarNav>
      <CForm class="d-flex">
        <CFormInput type="search" class="me-2" placeholder="Search"/>
        <CButton type="submit" color="light" variant="outline">Search</CButton>
      </CForm>
    </CCollapse>
  </CContainer>
</CNavbar>
<br/>
<CNavbar expand="lg" color-scheme="light" style="background-color: #e3f2fd">
  <CContainer fluid>
    <CNavbarBrand href="#">Navbar</CNavbarBrand>
    <CNavbarToggler aria-label="Toggle navigation" aria-expanded={visible} @click="visible = !visible"/>
    <CCollapse class="navbar-collapse" :visible="visible">
      <CNavbarNav>
        <CNavItem>
          <CNavLink href="#" active>
            Home
          </CNavLink>
        </CNavItem>
        <CNavItem>
          <CNavLink href="#">Link</CNavLink>
        </CNavItem>
        <CDropdown variant="nav-item" :popper="false">
          <CDropdownToggle color="secondary">Dropdown button</CDropdownToggle>
          <CDropdownMenu>
            <CDropdownItem href="#">Action</CDropdownItem>
            <CDropdownItem href="#">Another action</CDropdownItem>
            <CDropdownDivider />
            <CDropdownItem href="#">Something else here</CDropdownItem>
          </CDropdownMenu>
        </CDropdown>
        <CNavItem>
          <CNavLink href="#" disabled>
            Disabled
          </CNavLink>
        </CNavItem>
      </CNavbarNav>
      <CForm class="d-flex">
        <CFormInput type="search" class="me-2" placeholder="Search"/>
        <CButton type="submit" color="primary" variant="outline">Search</CButton>
      </CForm>
    </CCollapse>
  </CContainer>
</CNavbar>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110

Containers #

Although it's not required, you can wrap a <CNavbar> in a <CContainer> to center it on a page–though note that an inner container is still required. Or you can add a container inside the <CNavbar> to only center the contents of a fixed or static top navbar.

Navbar
<CContainer>
  <CNavbar color-scheme="light" class="bg-light">
    <CContainer fluid>
      <CNavbarBrand href="#">Navbar</CNavbarBrand>
    </CContainer>
  </CNavbar>
</CContainer>
1
2
3
4
5
6
7

Use any of the responsive containers to change how wide the content in your navbar is presented.

Navbar
<CNavbar color-scheme="light" class="bg-light">
  <CContainer breakpoint="md">
    <CNavbarBrand href="#">Navbar</CNavbarBrand>
  </CContainer>
</CNavbar>
1
2
3
4
5

Placement #

Use our placement properly to place navbars in non-static positions. Choose from fixed to the top, fixed to the bottom, or stickied to the top (scrolls with the page until it reaches the top, then stays there). Fixed navbars use position: fixed, meaning they're pulled from the normal flow of the DOM and may require custom CSS (e.g., padding-top on the <body>) to prevent overlap with other elements.

Also note that .sticky-top uses position: sticky, which isn't fully supported in every browser.

Default
<CNavbar color-scheme="light" class="bg-light">
  <CContainer fluid>
    <CNavbarBrand href="#">Default</CNavbarBrand>
  </CContainer>
</CNavbar>
1
2
3
4
5
Fixed top
<CNavbar color-scheme="light" class="bg-light" placement="fixed-top">
  <CContainer fluid>
    <CNavbarBrand href="#">Fixed top</CNavbarBrand>
  </CContainer>
</CNavbar>
1
2
3
4
5
Fixed bottom
<CNavbar color-scheme="light" class="bg-light" placement="fixed-bottom">
  <CContainer fluid>
    <CNavbarBrand href="#">Fixed bottom</CNavbarBrand>
  </CContainer>
</CNavbar>
1
2
3
4
5
Sticky top
<CNavbar color-scheme="light" class="bg-light" placement="sticky-top">
  <CContainer fluid>
    <CNavbarBrand href="#">Sticky top</CNavbarBrand>
  </CContainer>
</CNavbar>
1
2
3
4
5

Responsive behaviors #

Navbars can use <CNavbarToggler>, <CCollapse>, and expand="{sm|md|lg|xl|xxl}" property to determine when their content collapses behind a button. In combination with other utilities, you can easily choose when to show or hide particular elements.

For navbars that never collapse, add the expand boolean property on the <CNavbar>. For navbars that always collapse, don't add any property.

Toggler #

Navbar togglers are left-aligned by default, but should they follow a sibling element like a <CNavbarBrand>, they'll automatically be aligned to the far right. Reversing your markup will reverse the placement of the toggler. Below are examples of different toggle styles.

With no <CNavbarBrand> shown at the smallest breakpoint:

Hidden brand
  • Home
  • Link
  • Disabled
<CNavbar expand="lg" color-scheme="light" class="bg-light">
  <CContainer fluid>
    <CNavbarToggler aria-label="Toggle navigation" aria-expanded={visible} @click="visible = !visible"/>
    <CCollapse class="navbar-collapse" :visible="visible">
      <CNavbarBrand href="#">Hidden brand</CNavbarBrand>
      <CNavbarNav class="me-auto mb-2 mb-lg-0">
        <CNavItem>
          <CNavLink href="#" active>
            Home
          </CNavLink>
        </CNavItem>
        <CNavItem>
          <CNavLink href="#">Link</CNavLink>
        </CNavItem>
        <CNavItem>
          <CNavLink href="#" disabled>
            Disabled
          </CNavLink>
        </CNavItem>
      </CNavbarNav>
      <CForm class="d-flex">
        <CFormInput type="search" class="me-2" placeholder="Search"/>
        <CButton type="submit" color="success" variant="outline">Search</CButton>
      </CForm>
    </CCollapse>
  </CContainer>
</CNavbar>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27

With a brand name shown on the left and toggler on the right:

Navbar
  • Home
  • Link
  • Disabled
<CNavbar expand="lg" color-scheme="light" class="bg-light">
  <CContainer fluid>
    <CNavbarBrand href="#">Navbar</CNavbarBrand>
    <CNavbarToggler aria-label="Toggle navigation" aria-expanded={visible} @click="visible = !visible"/>
    <CCollapse class="navbar-collapse" :visible="visible">
      <CNavbarNav class="me-auto mb-2 mb-lg-0">
        <CNavItem>
          <CNavLink href="#" active>
            Home
          </CNavLink>
        </CNavItem>
        <CNavItem>
          <CNavLink href="#">Link</CNavLink>
        </CNavItem>
        <CNavItem>
          <CNavLink href="#" disabled>
            Disabled
          </CNavLink>
        </CNavItem>
      </CNavbarNav>
      <CForm class="d-flex">
        <CFormInput type="search" class="me-2" placeholder="Search"/>
        <CButton type="submit" color="success" variant="outline">Search</CButton>
      </CForm>
    </CCollapse>
  </CContainer>
</CNavbar>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27

With a toggler on the left and brand name on the right:

Navbar
  • Home
  • Link
  • Disabled
<CNavbar expand="lg" color-scheme="light" class="bg-light">
  <CContainer fluid>
    <CNavbarToggler aria-label="Toggle navigation" aria-expanded={visible} @click="visible = !visible"/>
    <CNavbarBrand href="#">Navbar</CNavbarBrand>
    <CCollapse class="navbar-collapse" :visible="visible">
      <CNavbarNav class="me-auto mb-2 mb-lg-0">
        <CNavItem>
          <CNavLink href="#" active>
            Home
          </CNavLink>
        </CNavItem>
        <CNavItem>
          <CNavLink href="#">Link</CNavLink>
        </CNavItem>
        <CNavItem>
          <CNavLink href="#" disabled>
            Disabled
          </CNavLink>
        </CNavItem>
      </CNavbarNav>
      <CForm class="d-flex">
        <CFormInput type="search" class="me-2" placeholder="Search"/>
        <CButton type="submit" color="success" variant="outline">Search</CButton>
      </CForm>
    </CCollapse>
  </CContainer>
</CNavbar>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27

External content #

Sometimes you want to use the collapse plugin to trigger a container element for content that structurally sits outside of the <CNavbar>.

Collapsed content
Toggleable via the navbar brand.
<template>
  <CCollapse id="navbarToggleExternalContent" :visible="visibleExternalContent">
    <div class="bg-dark p-4">
      <h5 class="text-white h4">Collapsed content</h5>
      <span class="text-medium-emphasis-inverse">Toggleable via the navbar brand.</span>
    </div>
  </CCollapse>
  <CNavbar colorScheme="dark" class="bg-dark">
    <CContainer fluid>
      <CNavbarToggler
        aria-controls="navbarToggleExternalContent"
        aria-label="Toggle navigation"
        @click="visibleExternalContent = !visibleExternalContent"
      />
    </CContainer>
  </CNavbar>
</template>
<script>
  export default {
    data() {
      return { 
        visibleExternalContent: false,
      }
    }
  }
</script>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26

Offcanvas #

Transform your expanding and collapsing navbar into an offcanvas drawer with the offcanvas plugin. We extend both the offcanvas default styles and use our expand="*" prop to create a dynamic and flexible navigation sidebar.

In the example below, to create an offcanvas navbar that is always collapsed across all breakpoints, omit the expand="*" prop entirely.

Offcanvas
  • Home
  • Link
  • Dropdown button
    ActionAnother action
    Something else here
  • Disabled

To create an offcanvas navbar that expands into a normal navbar at a specific breakpoint like xxl, use expand="xxl" property.

Offcanvas
  • Home
  • Link
  • Dropdown button
    ActionAnother action
    Something else here
  • Disabled

Customizing #

CSS variables #

Vue navbars use local CSS variables on .navbar for enhanced real-time customization. Values for the CSS variables are set via Sass, so Sass customization is still supported, too.

--cui-navbar-padding-x: #{if($navbar-padding-x == null, 0, $navbar-padding-x)};
--cui-navbar-padding-y: #{$navbar-padding-y};
--cui-navbar-color: #{$navbar-light-color};
--cui-navbar-hover-color: #{$navbar-light-hover-color};
--cui-navbar-disabled-color: #{$navbar-light-disabled-color};
--cui-navbar-active-color: #{$navbar-light-active-color};
--cui-navbar-brand-padding-y: #{$navbar-brand-padding-y};
--cui-navbar-brand-margin-end: #{$navbar-brand-margin-end};
--cui-navbar-brand-font-size: #{$navbar-brand-font-size};
--cui-navbar-brand-color: #{$navbar-light-brand-color};
--cui-navbar-brand-hover-color: #{$navbar-light-brand-hover-color};
--cui-navbar-nav-link-padding-x: #{$navbar-nav-link-padding-x};
--cui-navbar-toggler-padding-y: #{$navbar-toggler-padding-y};
--cui-navbar-toggler-padding-x: #{$navbar-toggler-padding-x};
--cui-navbar-toggler-font-size: #{$navbar-toggler-font-size};
--cui-navbar-toggler-icon-bg: #{escape-svg($navbar-light-toggler-icon-bg)};
--cui-navbar-toggler-border-color: #{$navbar-light-toggler-border-color};
--cui-navbar-toggler-border-radius: #{$navbar-toggler-border-radius};
--cui-navbar-toggler-focus-width: #{$navbar-toggler-focus-width};
--cui-navbar-toggler-transition: #{$navbar-toggler-transition};
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

Some additional CSS variables are also present on .navbar-nav:

--cui-nav-link-padding-x: 0;
--cui-nav-link-padding-y: #{$nav-link-padding-y};
--cui-nav-link-color: var(--cui-navbar-color);
--cui-nav-link-hover-color: var(--cui-navbar-hover-color);
--cui-nav-link-disabled-color: var(--cui-navbar-disabled-color);
1
2
3
4
5

How to use CSS variables #

const vars = { 
  '--my-css-var': 10,
  '--my-another-css-var': "red" 
}
return <CNavbar :style="vars">...</CNavbar>
1
2
3
4
5

SASS variables #

$navbar-padding-y:                  $spacer * .5;
$navbar-padding-x:                  null;

$navbar-nav-link-padding-x:         .5rem;

$navbar-brand-font-size:            $font-size-lg;
// Compute the navbar-brand padding-y so the navbar-brand will have the same height as navbar-text and nav-link
$nav-link-height:                   $font-size-base * $line-height-base + $nav-link-padding-y * 2;
$navbar-brand-height:               $navbar-brand-font-size * $line-height-base;
$navbar-brand-padding-y:            ($nav-link-height - $navbar-brand-height) * .5;
$navbar-brand-margin-end:           1rem;

$navbar-toggler-padding-y:          .25rem;
$navbar-toggler-padding-x:          .75rem;
$navbar-toggler-font-size:          $font-size-lg;
$navbar-toggler-border-radius:      $btn-border-radius;
$navbar-toggler-focus-width:        $btn-focus-width;
$navbar-toggler-transition:         box-shadow .15s ease-in-out;

$navbar-dark-color:                 $medium-emphasis-inverse;
$navbar-dark-hover-color:           $high-emphasis-inverse;
$navbar-dark-active-color:          $high-emphasis-inverse;
$navbar-dark-disabled-color:        $disabled-inverse;
$navbar-dark-toggler-icon-bg:       url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'><path stroke='#{$navbar-dark-color}' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/></svg>");
$navbar-dark-toggler-border-color:  rgba($white, .1);

$navbar-light-color:                $medium-emphasis;
$navbar-light-hover-color:          $high-emphasis;
$navbar-light-active-color:         $high-emphasis;
$navbar-light-disabled-color:       $disabled;
$navbar-light-toggler-icon-bg:      url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'><path stroke='#{$navbar-light-color}' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/></svg>");
$navbar-light-toggler-border-color: rgba($black, .1);

$navbar-light-brand-color:                $navbar-light-active-color;
$navbar-light-brand-hover-color:          $navbar-light-active-color;
$navbar-dark-brand-color:                 $navbar-dark-active-color;
$navbar-dark-brand-hover-color:           $navbar-dark-active-color;
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37

API #

CNavbar #

import { CNavbar } from '@coreui/vue'
// or
import CNavbar from '@coreui/vue/src/components/navbar/CNavbar'
1
2
3

Props #

Prop nameDescriptionTypeValuesDefault
colorSets the color context of the component to one of CoreUI’s themed colors.string'primary', 'secondary', 'success', 'danger', 'warning', 'info', 'dark', 'light', string
color-schemeSets if the color of text should be colored for a light or dark dark background.string'dark', 'light'-
componentComponent used for the root node. Either a string to use a HTML element or a component.string-'nav'
containerDefines optional container wrapping children elements.boolean|stringboolean, 'sm', 'md', 'lg', 'xl', 'xxl', 'fluid'-
expandDefines the responsive breakpoint to determine when content collapses.boolean|stringboolean, 'sm', 'md', 'lg', 'xl', 'xxl'-
placementPlace component in non-static positions.string'fixed-top', 'fixed-bottom', 'sticky-top'-

CNavbarBrand #

import { CNavbarBrand } from '@coreui/vue'
// or
import CNavbarBrand from '@coreui/vue/src/components/navbar/CNavbarBrand'
1
2
3

Props #

Prop nameDescriptionTypeValuesDefault
componentComponent used for the root node. Either a string to use a HTML element or a component.string-'a'
hrefThe href attribute specifies the URL of the page the link goes to.string--

CNavbarNav #

import { CNavbarNav } from '@coreui/vue'
// or
import CNavbarNav from '@coreui/vue/src/components/navbar/CNavbarNav'
1
2
3

Props #

Prop nameDescriptionTypeValuesDefault
componentComponent used for the root node. Either a string to use a HTML element or a component.string-'ul'
On this page
  • Supported content
  • Basic usage
    • Brand
    • Nav
    • Forms
    • Text
  • Color schemes
  • Containers
  • Placement
  • Responsive behaviors
    • Toggler
    • External content
    • Offcanvas
  • Customizing
    • CSS variables
    • SASS variables
  • API
    • CNavbar
    • CNavbarBrand
    • CNavbarNav
  • GitHub
  • Twitter
  • CoreUI (Vanilla)
  • CoreUI for Angular
  • CoreUI for React.js

CoreUI for Vue is Open Source UI Components Library for Vue.js.

CoreUI code licensed MIT, docs CC BY 3.0. CoreUI PRO requires a commercial license.