A breadcrumb navigation component that displays a hierarchical trail of links, helping users understand their current location within the application.
Constructor
Creates a new breadcrumb component with default settings.
Methods
addItem
addItem(String text, Runnable action)
Adds a clickable breadcrumb item. The text to display for this breadcrumb item
The action to execute when the item is clicked
addItem(String text, Node icon, Runnable action)
Adds a clickable breadcrumb item with an icon. The text to display for this breadcrumb item
The icon to display alongside the text
The action to execute when the item is clicked
Adds the current (last) breadcrumb item without an action. The text to display for the current breadcrumb item
addItem(String text, Node icon)
Adds the current (last) breadcrumb item with an icon. The text to display for the current breadcrumb item
The icon to display alongside the text
Configuration
Changes the separator character between breadcrumb items. The separator string (default: ”/”)
setActiveColor(String color)
Changes the color of the active (current) breadcrumb item. The color variant: “primary”, “success”, “danger”, “warning”, or “info”
Removes all breadcrumb items.
Sets multiple breadcrumb items at once. All items except the last are navigable. Variable number of path strings to display
Usage Example
JBreadcrumb bc = new JBreadcrumb ();
bc . addItem ( "Home" , () -> navigate ( "home" ));
bc . addItem ( "Users" , () -> navigate ( "users" ));
bc . addItem ( "Profile" ); // Current page (no action)
// With custom separator
bc . setSeparator ( ">" );
// With active color
bc . setActiveColor ( "primary" );
Style Classes
.j-breadcrumb - Main container
.j-breadcrumb-separator - Separator element
.j-breadcrumb-item - Normal (clickable) item
.j-breadcrumb-item-active - Active (current) item
.j-breadcrumb-link - Link label
.j-breadcrumb-active - Active label
.j-breadcrumb-color-{variant} - Color variant classes