1. Domino UI
  2. Components
  3. Alerts
Top Simple Addons Body Docs

Navigation bar

The NavBar class represents a navigation bar UI component that typically contains a title, description, and a body.

Usage Example:

 
 // Create a NavBar with a title
 NavBar navBar = NavBar.create("My Navigation Bar");

 // Set a description for the NavBar
 navBar.setDescription("This is a sample navigation bar.");

 // Customize the title element
 navBar.withTitle((nav, titleElement) -> {
     titleElement.addCss("custom-title");
     titleElement.setTextContent("Custom Title");
 });

 // Customize the body element
 navBar.withBody((nav, bodyElement) -> {
     bodyElement.addCss("custom-body");
     bodyElement.appendChild(TextNode.of("Custom Body Content"));
 });
 

See also :

Anatomy

navbar-anatomy.
  1. navigation prefix addons.
  2. Navigation bar title.
  3. Navigation bar body.
  4. Navigation bar postfix addons.

Examples

Simple navigation bar Simple content header with title and optional description

Navigation bar addons Navigation bar can have optional prefix and postfix addons.

Navigation bar body Navigation bar can have other components added to its main body

API Docs: NavBar

Constructors

public void NavBar()
Creates a new NavBar instance with default settings.
public void NavBar(Node title)
Creates a new NavBar instance with the specified title.

title

The title to display in the navigation bar.

public void NavBar(String title, String description)
Constructs a NavBar with the specified title and description.

title

The title to be displayed in the navigation bar.

description

The description to be displayed in the navigation bar.

Static methods

public static NavBar create()
Creates a new NavBar instance with default settings.

Returns:

A new NavBar instance.

public static NavBar create(String title)
Creates a new NavBar instance with the specified title.

title

The title to display in the navigation bar.



Returns:

A new NavBar instance with the specified title.

public static NavBar create(Node title)
Creates a new NavBar instance with the specified title.

title

The title to display in the navigation bar.



Returns:

A new NavBar instance with the specified title.

We are a group of passionate people who love what we do

Donate & Support Us