Package org.patternfly.component.toolbar
package org.patternfly.component.toolbar
Provides a toolbar component for organizing actions, filters, and controls in a horizontal layout.
A toolbar is a container for grouping related controls such as search inputs, buttons, filters, and pagination. It supports content sections, item and group types, toggle groups for responsive behavior, filter label groups, adjustable insets, sticky positioning, and color variants.
Key Classes
AlignItems- Enumeration of cross-axis alignment options for toolbar itemsRowWrap- Enumeration of row wrapping options for toolbar contentToolbar- Main toolbar containerToolbarColor- Enumeration of toolbar color variants (no-background, primary, secondary)ToolbarContent- Content section within a toolbarToolbarFilterContent- Filter content with label groupsToolbarFilterLabelGroup- Label group for displaying active filter labelsToolbarGroup- Group of toolbar itemsToolbarGroupType- Typed group variants (action, filter, etc.)ToolbarItem- Individual toolbar itemToolbarItemType- Typed item variants (bulk-select, overflow-menu, etc.)ToolbarToggleGroup- Responsive toggle group
Usage
Create a toolbar with search input and action buttons:
import static org.patternfly.component.button.Button.button;
import static org.patternfly.component.textinputgroup.SearchInput.searchInput;
import static org.patternfly.component.toolbar.Toolbar.toolbar;
import static org.patternfly.component.toolbar.ToolbarContent.toolbarContent;
import static org.patternfly.component.toolbar.ToolbarItem.toolbarItem;
Toolbar toolbar = toolbar()
.addContent(toolbarContent()
.addItem(toolbarItem()
.add(searchInput("search-0")))
.addItem(toolbarItem()
.add(button("Action").secondary()))
.addDivider()
.addItem(toolbarItem()
.add(button("Primary").primary())));
Create a toolbar with grouped action buttons:
import static org.patternfly.component.button.Button.button;
import static org.patternfly.component.toolbar.Toolbar.toolbar;
import static org.patternfly.component.toolbar.ToolbarContent.toolbarContent;
import static org.patternfly.component.toolbar.ToolbarGroup.toolbarGroup;
import static org.patternfly.component.toolbar.ToolbarGroupType.actionGroup;
import static org.patternfly.component.toolbar.ToolbarItem.toolbarItem;
Toolbar grouped = toolbar()
.addContent(toolbarContent()
.addGroup(toolbarGroup(actionGroup)
.addItem(toolbarItem().add(button("Edit").secondary()))
.addItem(toolbarItem().add(button("Clone").secondary())))
.addDivider()
.addGroup(toolbarGroup(actionGroup)
.addItem(toolbarItem().add(button("Save").primary()))));
- See Also:
-
ClassDescriptionDefines the cross-axis alignment of items within a
Toolbar.Defines the row wrapping behavior forToolbarcontent.A toolbar allows a user to manage and manipulate a data set.Defines the background color variants available for aToolbar.Container for a toolbar content.A content area for active filters within aToolbarcomponent.A group of filter labels within theToolbarfilter content area.Container for a toolbar group.Defines the semantic type of aToolbarGroupwithin aToolbar.Container for a toolbar item.Defines the semantic type of aToolbarItemwithin aToolbar.Container for a toolbar group.