Package org.patternfly.component.emptystate
package org.patternfly.component.emptystate
Provides the PatternFly empty state component and its subcomponents for displaying placeholder content when no data is
available.
An empty state with a loading spinner:
An empty state is used to communicate that a page, section, or area of the UI has no data to show. It typically includes a title, an icon, a description, and action buttons. Empty states support different sizes, status severities, and a loading spinner variant.
Usage
A basic empty state with icon, body text, and actions:import static org.patternfly.component.button.Button.button;
import static org.patternfly.component.emptystate.EmptyState.emptyState;
import static org.patternfly.component.emptystate.EmptyStateActions.emptyStateActions;
import static org.patternfly.component.emptystate.EmptyStateBody.emptyStateBody;
import static org.patternfly.component.emptystate.EmptyStateFooter.emptyStateFooter;
import static org.patternfly.icon.IconSets.fas.cubes;
emptyState()
.text("Empty State")
.icon(cubes())
.addBody(emptyStateBody().text(
"This represents the empty state pattern in PatternFly."))
.addFooter(emptyStateFooter()
.addActions(emptyStateActions()
.add(button("Primary action").primary()))
.addActions(emptyStateActions()
.add(button("Multiple").link())
.add(button("Action Buttons").link())));
import static org.patternfly.component.emptystate.EmptyState.emptyState;
emptyState()
.text("Loading...")
.spinner("Loading...");
- See Also:
-
ClassesClassDescriptionAn empty state is a screen that is not yet populated with data or information.