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 :
public void NavBar()
NavBar instance with default settings.
public void NavBar(Node title)
NavBar instance with the specified title.
title
The title to display in the navigation bar.
public void NavBar(String title, String description)
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.
public static NavBar create()
NavBar instance with default settings.
A new NavBar instance.
public static NavBar create(String title)
NavBar instance with the specified title.
title
The title to display in the navigation bar.
A new NavBar instance with the specified title.
public static NavBar create(Node title)
NavBar instance with the specified title.
title
The title to display in the navigation bar.
A new NavBar instance with the specified title.