On This Page
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:
| Property | Description | Notes |
|---|---|---|
| id | id for this component | |
| cssClasses | list of css classes | content of the css attribute |
| style | inline style attributes | content of the style attribute |
| pill | rounded borders | true/false |
| color | one of normal, success, error, contrast, primary | |
| small | true/false |
You can see a full explanation of those properties at https://vaadin.com/docs/latest/components/badge