Clay
Skip to ContentClayClay by Liferay
  • Get Started
    • Introduction
    • What is Clay
    • Importing the JS Component
    • Using JS Components with Metal.js
    • Web Components
  • Foundations
    • Grid
    • Typography
  • Lexicon Core Components
    • Alerts
    • Badges
    • Buttons
    • Cards
    • Charts
      • Advanced Examples
        • Axis Label
        • Axis Range
        • Data Color
        • Gridlines
        • Predictive forecasting
        • Regions
        • X Axis Tick Formatting
      • Basic Examples
        • Bar Chart
        • Bubble Chart
        • Combination Chart
        • Donut Chart
        • Gauge Chart
        • Geomap Chart
        • Line Chart
        • Pie Chart
        • Scatter Chart
        • Spline Chart
        • Step Chart
    • Dataset Display
    • Dropdown Menu
    • Forms
      • Checkbox, Radio, and Toggle
      • Forms
      • Forms Hierarchy
      • Forms Navigation
      • Multi Step Form
      • Multi Step Form Simplified
      • Selectors
      • Text Input
      • Text Input Group
      • Text Input Localizable
      • Text Input Variations
    • Icons
    • Labels
    • Link
    • List
    • Loading Indicator
    • Modals
    • Navigation
      • Breadcrumbs
      • Navigation Bar
      • Vertical Navigation
    • Pagination
    • Popovers and Tooltips
    • Progress Bars
    • Sidebar
      • Info Panel
    • Stickers
    • Table
      • Inline Edit Table
      • Table
    • Tabs
    • Toolbars
      • Management Toolbar
  • CSS Framework
    • SCSS
    • Class Helpers
    • Satellite Components
      • Alerts
      • Badges
      • Button Group
      • Cards
      • Dropdown Menu
      • Forms
        • Form Elements
        • Form Elements (Input Groups)
        • Form Elements (Validation)
      • Images (Aspect Ratios)
      • Images and Thumbnails
      • Labels
      • Links
      • List Groups
      • Modals
      • Nav
      • Navigation
        • Header
      • Paginations
      • Panels
      • Popovers and Tooltips
      • Progress Bars
      • Stickers
      • Tables
      • Tbar (Toolbar)
      • Timelines
      • Toggle Switch
    • Page Examples
      • Card View Template
      • Document Upload
      • List View Template
      • Table View Template
      • Users and Organizations
  • News

Navigation Bar

Description

A navigation bar, navbar, is an horizontal bar that provides several access points to different parts of a system.

Check the Lexicon Navigation Bar Pattern for a more in-depth look at the motivations and proper usage of this component.

DEFAULT

The positive navigation bar is defined for Sites. It displays navigation items in a light background with dark text.

App Section 2
  • App Section 1
  • App Section 2
  • App Section 3
  • More
    App Section 4 App Section 5 App Section 6 App Section 7
{call ClayNavigationBar.render}
	{param items: [
		[
			'title': 'App Section 1',
			'url': '#1'
		],
		[
			'active'; true,
			'title': 'App Section 2',
			'url': '#1'
		],
		[
			'title': 'App Section 3',
			'url': '#1'
		],
		[
			'title': 'App Section 4',
			'url': '#1'
		],
		[
			'title': 'App Section 5',
			'url': '#1'
		],
		[
			'title': 'App Section 6',
			'url': '#1'
		],
		[
			'title': 'App Section 7',
			'url': '#1'
		]
	] /}
	{param spritemap: '/images/icons/icons.svg' /}
{/call}
<clay-navigation-bar
	items='[
		{"title": "App Section 1", "url": "#1"},
		{"title": "App Section 2", "url": "#1"},
		{"title": "App Section 3", "url": "#1"},
		{"title": "App Section 4", "url": "#1"},
		{"title": "App Section 5", "url": "#1"},
		{"title": "App Section 6", "url": "#1"},
		{"title": "App Section 7", "url": "#1"}
	]'
	spritemap="/images/icons/icons.svg">
</clay-navigation-bar>
<nav class="navbar navbar-collapse-absolute navbar-expand-md navbar-underline navigation-bar navigation-bar-light">
	<div class="container">
		<a aria-controls="navigationBarCollapse00" aria-expanded="false" aria-label="Toggle Navigation" class="collapsed navbar-toggler navbar-toggler-link" data-toggle="collapse" href="#navigationBarCollapse00" role="button">
			<span class="navbar-text-truncate">App Section 2</span>
			<svg class="lexicon-icon lexicon-icon-caret-bottom" focusable="false" role="presentation">
				<use href="/images/icons/icons.svg#caret-bottom" />
			</svg>
		</a>
		<div class="collapse navbar-collapse" id="navigationBarCollapse00">
			<div class="container">
				<ul class="navbar-nav">
					<li class="nav-item">
						<a class="nav-link" href="#1">
							<span class="navbar-text-truncate">App Section 1</span>
						</a>
					</li>
					<li aria-label="Current Page" class="nav-item">
						<a class="active nav-link" href="#1">
							<span class="navbar-text-truncate">App Section 2</span>
						</a>
					</li>
					<li class="nav-item">
						<a class="nav-link" href="#1">
							<span class="navbar-text-truncate">App Section 3</span>
						</a>
					</li>
					<li class="dropdown nav-item show-dropdown-on-collapse">
						<a aria-expanded="false" aria-haspopup="true" class="dropdown-toggle nav-link" data-toggle="dropdown" href="#1" role="button">
							<span class="navbar-text-truncate">More</span>
							<svg class="lexicon-icon lexicon-icon-caret-bottom" focusable="false" role="presentation">
								<use href="/images/icons/icons.svg#caret-bottom" />
							</svg>
						</a>
						<div aria-labelledby="" class="dropdown-menu">
							<a class="dropdown-item" href="#1">App Section 4</a>
							<a class="dropdown-item" href="#1">App Section 5</a>
							<a class="dropdown-item" href="#1">App Section 6</a>
							<a class="dropdown-item" href="#1">App Section 7</a>
						</div>
					</li>
				</ul>
			</div>
		</div>
	</div>
</nav>

INVERTED

The negative navigation bar is defined for Admin controls. It displays navigation items in a dark background with light text. It is always placed right below the header.

App Section 2
  • App Section 1
  • App Section 2
  • App Section 3
  • More
    App Section 4 App Section 5 App Section 6 App Section 7
{call ClayNavigationBar.render}
	{param inverted: true /}
	{param items: [
		[
			'title': 'App Section 1',
			'url': '#1'
		],
		[
			'active'; true,
			'title': 'App Section 2',
			'url': '#1'
		],
		[
			'title': 'App Section 3',
			'url': '#1'
		],
		[
			'title': 'App Section 4',
			'url': '#1'
		],
		[
			'title': 'App Section 5',
			'url': '#1'
		],
		[
			'title': 'App Section 6',
			'url': '#1'
		],
		[
			'title': 'App Section 7',
			'url': '#1'
		]
	] /}
	{param spritemap: '/images/icons/icons.svg' /}
{/call}
<clay-navigation-bar
	inverted="true"
	items='[
		{"title": "App Section 1", "url": "#1"},
		{"title": "App Section 2", "url": "#1"},
		{"title": "App Section 3", "url": "#1"},
		{"title": "App Section 4", "url": "#1"},
		{"title": "App Section 5", "url": "#1"},
		{"title": "App Section 6", "url": "#1"},
		{"title": "App Section 7", "url": "#1"}
	]'
	spritemap="/images/icons/icons.svg">
</clay-navigation-bar>
<nav class="navbar navbar-collapse-absolute navbar-expand-md navbar-underline navigation-bar navigation-bar-secondary">
	<div class="container">
		<a aria-controls="navigationBarCollapse00" aria-expanded="false" aria-label="Toggle Navigation" class="collapsed navbar-toggler navbar-toggler-link" data-toggle="collapse" href="#navigationBarCollapse00" role="button">
			<span class="navbar-text-truncate">App Section 2</span>
			<svg class="lexicon-icon lexicon-icon-caret-bottom" focusable="false" role="presentation">
				<use href="/images/icons/icons.svg#caret-bottom" />
			</svg>
		</a>
		<div class="collapse navbar-collapse" id="navigationBarCollapse00">
			<div class="container">
				<ul class="navbar-nav">
					<li class="nav-item">
						<a class="nav-link" href="#1">
							<span class="navbar-text-truncate">App Section 1</span>
						</a>
					</li>
					<li aria-label="Current Page" class="nav-item">
						<a class="active nav-link" href="#1">
							<span class="navbar-text-truncate">App Section 2</span>
						</a>
					</li>
					<li class="nav-item">
						<a class="nav-link" href="#1">
							<span class="navbar-text-truncate">App Section 3</span>
						</a>
					</li>
					<li class="dropdown nav-item show-dropdown-on-collapse">
						<a aria-expanded="false" aria-haspopup="true" class="dropdown-toggle nav-link" data-toggle="dropdown" href="#1" role="button">
							<span class="navbar-text-truncate">More</span>
							<svg class="lexicon-icon lexicon-icon-caret-bottom" focusable="false" role="presentation">
								<use href="/images/icons/icons.svg#caret-bottom" />
							</svg>
						</a>
						<div aria-labelledby="" class="dropdown-menu">
							<a class="dropdown-item" href="#1">App Section 4</a>
							<a class="dropdown-item" href="#1">App Section 5</a>
							<a class="dropdown-item" href="#1">App Section 6</a>
							<a class="dropdown-item" href="#1">App Section 7</a>
						</div>
					</li>
				</ul>
			</div>
		</div>
	</div>
</nav>

API

Property Description Type Required Default
data
Data to add to the element. object false undefined
defaultEventHandler
Object that wires events with default listeners object|undefined false undefined
elementClasses
CSS classes to be applied to the element. string|undefined false undefined
id
Id to be applied to the element. string|undefined false undefined
inverted
The display style attribute. boolean false false
items
List of items to show in the Navbar. Array true undefined
spritemap
The path to the SVG spritemap file containing the icons. string true undefined

Except as otherwise noted, the content of this site is licensed under CC BY-SA 4.0 license.