Package org.patternfly.component.badge
package org.patternfly.component.badge
Provides the PatternFly badge component for displaying counts and status indicators.
A badge is used to annotate other information like a label or an object name. Badges are typically used to reflect counts such as the number of unread items or the number of objects in a collection. They can be displayed in a read or unread state and support custom display formatting and value limits.
Usage
Read and unread badges:
Badge readBadge = badge(7).read();
Badge unreadBadge = badge(24).unread();
Badge limitedBadge = badge(1000).limit(999).unread();
Badges with custom display formatting:
Badge customBadge = badge(7).read()
.display(v -> v + " items");
Badge limitedCustom = badge(1000).limit(999).unread()
.display(v -> v + " items")
.maxDisplay(v -> "More than you can handle");
- See Also:
-
ClassesClassDescriptionA badge is used to annotate other information like a label or an object name.