Navbar

Navigation and actions for the current screen.

When to use

Use a navbar for the application brand and primary destinations. Keep the current location clear, and use a Drawer when compact viewports need a separate navigation panel.

Default

Use .navbar for primary navigation.

HTML
<nav class="navbar">
	<div class="container">
		<span class="h4 mb-0">Nav Title</span>
	</div>
</nav>

Background colors

Combine .navbar with a background utility.

HTML
<nav class="navbar bg-primary">
	<div class="container">
		<span class="h4 mb-0">Nav Title</span>
	</div>
</nav>
<nav class="navbar bg-secondary">
	<div class="container">
		<span class="h4 mb-0">Nav Title</span>
	</div>
</nav>
<nav class="navbar bg-success">
	<div class="container">
		<span class="h4 mb-0">Nav Title</span>
	</div>
</nav>
<nav class="navbar bg-warning">
	<div class="container">
		<span class="h4 mb-0">Nav Title</span>
	</div>
</nav>
<nav class="navbar bg-error">
	<div class="container">
		<span class="h4 mb-0">Nav Title</span>
	</div>
</nav>

Inverse navbar

Use .bg-inverse for automatic contrasting text.

HTML
<nav class="navbar bg-inverse">
	<div class="container">
		<span class="h4 mb-0">Nav Title</span>
	</div>
</nav>

Use .navbar-logo for the brand link.

HTML
<nav class="navbar bg-surface">
	<div class="container">
		<a class="navbar-logo" href="#">Navbar Logo</a>
	</div>
</nav>

Accessibility and behavior

  • Use a labelled nav landmark when the bar contains navigation. Distinguish its name from breadcrumbs and other navigation landmarks.
  • Use real links for destinations and aria-current="page" on the current page link. Keep branding understandable through visible text or meaningful image alternative text.
  • Let links wrap or provide an explicitly controlled compact navigation pattern. The navbar styles do not implement a mobile toggle or drawer lifecycle.

CSS variables

Override these base defaults on the listed selector after the library styles. Variants and states may replace them; global tokens follow the active theme.

TokenDefaultPurposeScope / state
--navbar-bg-colorvar(--bg-surface)Background color..navbar
--navbar-text-colorvar(--text-color)Text color..navbar
--navbar-padding-yvar(--spacer-2)Top and bottom padding..navbar
--navbar-padding-xvar(--spacer-0)Left and right padding..navbar
--navbar-min-height3.75remMinimum height..navbar
--navbar-link-colorvar(--navbar-text-color)Navigation link color..navbar
--navbar-link-hover-colorvar(--action-color-hover)Navigation link color on hover..navbar
--navbar-link-active-colorvar(--action-color-active)Navigation link color when pressed..navbar
--navbar-logo-hover-colorvar(--action-color-hover)Logo link color on hover..navbar
--navbar-logo-active-colorvar(--action-color-active)Logo link color when pressed..navbar