diff --git a/components/bl-badge-component/README.md b/components/bl-badge-component/README.md index 1753943fb..894833f26 100644 --- a/components/bl-badge-component/README.md +++ b/components/bl-badge-component/README.md @@ -1,8 +1,8 @@ # Badge -This is a component of Backendless [UI-Builder](https://backendless.com/developers/#ui-builder) designer. It generates a small badge to the corner of its child(ren). Any text, custom image or Material icon can be as a content of the component. It is also possible to combine them. +The Badge component allows displaying specific data in the corner of the selected image/icon. The data must be a number or a string value which is fetched from the database and projected up into the right corner. This component is available in the [UI-Builder](https://backendless.com/developers/#ui-builder). -Customizations include adjustments of position, size, form, visibility, background color, label color and font size. +Customizations include adjustments of position, size, form, visibility, background color, label color and font size. The Badge supports a wide range of default icons that you can select in the Settings of the component in the UI-Builder.

main thumbnail @@ -10,9 +10,35 @@ Customizations include adjustments of position, size, form, visibility, backgrou ## Configuration -After adding the component to the page, specify the label of the badge. This can be done in UI-Builder designer or using codeless logic. +This component must be configured using both the UI-Builder and the Codeless Logic. In the UI-Builder you have to set the image and other properties that reflect the final look of the badge. -Then it is necessary to determine the contents of the component. Go to UI-Builder designer and specify one of the content field or combine them if you need. The component will be displayed with default properties. If you need even more flexibility, make other changes to its appearance in UI-Builder designer or by codeless logic. +

+ settings +

+ +To display a specific value in the corner of the badge, you must set the **Badge Label Logic** handler in the Codeless. + +

+ settings +

+ +Suppose you have a data table where the number of unread messages is stored: + +

+ settings +

+ +To display the number of unread messages in the corner of your badge, you have to set the Logic that fetches the data from the table. The example below retrieves an object from the data table called **cloudMessages**, and then the value of the property **unreadMessages** is extracted from the object: + +

+ settings +

+ +As the result, once the page is loaded, the number of unread messages is displayed in the corner of the badge: + +

+ settings +

## Properties @@ -42,7 +68,7 @@ Then it is necessary to determine the contents of the component. Go to UI-Builde | On Badge Click Event | when a user click on the badge | | | On Badge Mouse Over Event | when the mouse pointer hovers over the badge | | | On Badge Mouse Out Event | when the mouse pointer leaves the badge boundaries | | -| On Content Click Event | when a user click on the component content | | +| On Content Click Event | when a user clicks on the component content | | | On Content Mouse Over Event | when the mouse pointer hovers over the component content | | | On Content Mouse Out Event | when the mouse pointer leaves the component content boundaries | | diff --git a/components/bl-badge-component/example-images/component_badge_1.png b/components/bl-badge-component/example-images/component_badge_1.png new file mode 100644 index 000000000..62430d8ce Binary files /dev/null and b/components/bl-badge-component/example-images/component_badge_1.png differ diff --git a/components/bl-badge-component/example-images/component_badge_2.png b/components/bl-badge-component/example-images/component_badge_2.png new file mode 100644 index 000000000..6ffd511fc Binary files /dev/null and b/components/bl-badge-component/example-images/component_badge_2.png differ diff --git a/components/bl-badge-component/example-images/component_badge_3.png b/components/bl-badge-component/example-images/component_badge_3.png new file mode 100644 index 000000000..72123a3a4 Binary files /dev/null and b/components/bl-badge-component/example-images/component_badge_3.png differ diff --git a/components/bl-badge-component/example-images/component_badge_4.png b/components/bl-badge-component/example-images/component_badge_4.png new file mode 100644 index 000000000..058da2e8b Binary files /dev/null and b/components/bl-badge-component/example-images/component_badge_4.png differ diff --git a/components/bl-badge-component/example-images/component_badge_5.png b/components/bl-badge-component/example-images/component_badge_5.png new file mode 100644 index 000000000..c66ce56a9 Binary files /dev/null and b/components/bl-badge-component/example-images/component_badge_5.png differ