A badge to highlight some short info.

  • Fluent
  • Declarative

            Badge.builder()
                  .text("Hola")
                  .pill(true)
                  .primary(true)
                  .color(BadgeColor.success)
                  .build()

There is no declarative thing for badges. Just use a Badge record as in imperative.

Available properties

This is the list of available properties for a badge:

PropertyDescriptionNotes
idid for this component
cssClasseslist of css classescontent of the css attribute
styleinline style attributescontent of the style attribute
pillrounded borderstrue/false
colorone of normal, success, error, contrast, primary
smalltrue/false

You can see a full explanation of those properties at https://vaadin.com/docs/latest/components/badge