Bootstrap Badges for Xojo Web2.0 Controls

I’ve made a lightweight extension which allows you to add Bootstrap badges to Xojo Web2.0 Controls.

It looks like this:

BadgesOnLabels

BadgesOnPopupmenus

It currently works on Labels, Buttons and Popupmenus. More will be added over time.

If you want to use it, just download it from Github
https://github.com/FAESCH/Xojo-Web2.0-Bootstrap-Extensions

It’s really easy to use:

Label:
Weblabel.AddBadge(Text as String, Indicator as WebUIControl.Indicators = WebUIControl.Indicators.Default)

Button:
WebButton.AddBadge(Text as String, Indicator as WebUIControl.Indicators = WebUIControl.Indicators.Default)

Popupmenu
WebPopupmenu.AddBadgeAt(Row as Integer, Text as String, Indicator as WebUIControl.Indicators = WebUIControl.Indicators.Default)

7 Likes

Nice!

Thanks for sharing

1 Like

I found your extends very useful. I did changed them to this:

Extends b as WebButton, badgeText as String, Indicator as 
WebUIControl.Indicators = WebUIControl.Indicators.Default

Just to make sure there are no issues with this (yes it’s deprecated but just to be extra careful)

[Text keyword](http://documentation.xojo.com/api/deprecated/text.html)

Thanks for sharing your code :slight_smile:

Thanks for this tip. I changed it in the repository.
Also I added Badges for WebListbox:

4 Likes