how to add a badge to a button ?

How to add badge to a button (like the bell button in vaadin dashborad demo) ? I couldn’t get it to work



you can use the setIcon method of Button to do that. See some examples here:

Thanks but setIcon won’t add the icon over the button.
I am looking for a solution for something similar to the attached image
(see attached image)

Ah! That badge is actually just a Label that is aligned over the button with CSS.