Its super simple to show component badges like:

Just use styles:

Show 9 as label

Style.addStyleNames(comp, "f_badge_9");

Set border size and color:

Style.addStyleNames(comp, "f_badge_border_2_#aa0000");

Set alignment:

Style.addStyleNames(comp, "f_badge_align_bottomRight");

Possible values are: topLeft, topRight, bottomLeft, bottomRight, center

Set an offset for x and y position:

Style.addStyleNames(comp, "f_badge_offset_10_5");

or just x:

Style.addStyleNames(comp, "f_badge_offset_20");