Rating
Offers a quick way to gather user feedback.
The "Rating" widget is a UI element that's used for capturing user feedback for a specific service, product, or item. The widget displays a row of stars (or the icon of your choice), which the user can select to register an appropriate rating. The selected rating can then be used for various purposes, such as feedback, ranking, or recommendations.
Rating Properties
Property | Description |
---|---|
Shape | Choose from one of the available icon options. Note: On selecting "Custom Icon", you will have to provide the URLs of the custom icons. |
W - (Width) | Sets the width of the rating icon. |
H - (Height) | Sets the height of the rating icon. |
Half Select Rating [Checkbox] | Allows the rating to be changed at increments of "Half" a point. |
Custom URL (Selected/Unselected/HalfSelected) | Enter the URLs of the Custom Icons - for the Selected, Unselected, or Half-Selected options in the respective fields. |
Selected/Unselected [Tabs] | Switch between the properties Tabs for the Selected or the Unselected. |
Border Color | Changes the border color of the (un)selected icon. |
Fill Color | Changes the fill color of the (un)selected icon. |
Selection (Click/Hover) | Click: Displays the rating only on click. Hover: Enables a rating preview on mouseover; however, the rating is applied only on click. |
Show Rating Value [Checkbox] | Displays the rating value in numbers. |
Text Color | Sets the color of the rating value. |
Font Size | Sets the size of the rating value. |
API Methods
setLabel
Sets a Label for the component.
- Method
- Usage
setLabel(label: string): void
// Sets the following Label: (label value here).
a8forms.Rating("ratingId").setLabel("label value here")
setVisibility
Sets the Visibility flag for this component.
- Method
- Usage
setVisibility(visible: boolean): void
// Setting the visibility to "true" makes the element visible
a8forms.Rating("ratingId").setVisibility(true)
// Setting the visibility to "false" makes the element invisible
a8forms.Rating("ratingId").setVisibility(false)
setVisibilityCondition
Sets the visibility condition for this component.
- Method
- Usage
setVisibilityCondition(condition: string): void
// Sets a condition for changing the element's visibility status.
a8forms.Rating("ratingId").setVisibilityCondition("1 === 1")
Event Handlers
Event handlers allow you to set triggers for various actions based on the fired events. They are as follows:
onClick
onClick
- Sets the actions to be triggered when the component is clicked.