Skip to main content

Star Rating

The Star Rating component can be used to gather user feedback and provide a visual representation of ratings, helping users make informed decisions, provide social proof, and evaluate the quality or popularity of a product or service.

Why Use It?

  • Collect User Feedback: Ideal for capturing user opinions on products, services, or content in a simple, visual format.
  • Display Ratings: Perfect for showing aggregated scores, like average ratings for items, courses, or articles.
  • Enhanced User Experience: Offers an intuitive and interactive way for users to express preferences, including half-star precision for more accurate ratings.

Data

Property
Description
Expected Value
LabelText to display as the label for the star rating.String
Icon TypeSelect the icon to display for the rating.stars or heart
Number of starsTotal number of stars displayed on initial load. Default is 5.Integer
Default number of selected starsSets how many stars are selected by default. Default is 3.Integer or half
Allow editingToggle on to allow users to edit.Boolean (true / false)
Enable half starToggle on to allow selection of half stars. Default is false.Boolean (true / false)
TooltipsArray of strings used to show informative tooltips for each star. Mapped by index.Array of String (default: ["Very Poor","Poor","Average", "Good","Excellent"])

Events

Event
Description
On changeTriggers whenever the user clicks a star.
info

Check Action Reference docs to get the detailed information about all the Actions.

Component Specific Actions (CSA)

The following actions of the component can be controlled using the component-specific actions (CSA), you can trigger it using an event or use a RunJS query.

Action
DescriptionRunJS Query
setValue( )Sets the current rating value programmatically.components.starrating1.setValue()
resetValue( )Resets the rating to the default value.components.starrating1.resetValue()
setVisibility( )Controls the visibility of the component.components.starrating1.setVisibility()
setLoading( )Sets the component to a loading state.components.starrating1.setLoading()
setDisable( )Disables user interaction with the component.components.starrating1.setDisable()

Exposed Variables

Variables
Description
How To Access
valueHolds the value entered by the user whenever a rating is added on the component.{{components.starrating1.value}}
labelHolds the label name of the component.{{components.starrating1.label}}
isLoadingIndicates if the component is loading.{{components.starrating1.isLoading}}
isVisibleIndicates if the component is visible.{{components.starrating1.isVisible}}
isDisabledIndicates if the component is disabled.{{components.starrating1.isDisabled}}

Additional Actions

Action
Description
Configuration Options
Loading stateEnables a loading spinner, often used with isLoading to indicate progress. Toggle or set dynamically.Enable/disable the toggle button or dynamically configure the value by clicking on fx and entering a logical expression.
VisibilityControls component visibility. Toggle or set dynamically.Enable/disable the toggle button or dynamically configure the value by clicking on fx and entering a logical expression.
DisableEnables or disables the component. Toggle or set dynamically.Enable/disable the toggle button or dynamically configure the value by clicking on fx and entering a logical expression.
TooltipProvides additional information on hover. Set a string value for display.String (e.g., Select an option. ).

Devices

Property
Description
Expected Value
Show on desktopMakes the component visible in desktop view.You can set it with the toggle button or dynamically configure the value by clicking on fx and entering a logical expression.
Show on mobileMakes the component visible in mobile view.You can set it with the toggle button or dynamically configure the value by clicking on fx and entering a logical expression.

Styles

Label

PropertyDescriptionConfiguration Options
StyleChoose whether to keep the label in standard or legacy style.Dropdown: Standard, Legacy
Label colorChange the color of the label text.Color picker / HEX / RGBA / Custom Themes
AlignmentAdjust the placement of the label relative to the component.Side / Top and Left / Right
WidthSets the width of the label.Keep Auto width for standard sizing, or deselect to adjust using a slider or an fx expression returning a numeric value.

Icon

PropertyDescriptionConfiguration Options
Selected backgroundColor for selected icons (stars/hearts).Color picker / HEX / RGBA / Custom Themes
Unselected backgroundColor for unselected icons (stars/hearts).Color picker / HEX / RGBA / Custom Themes

Container

PropertyDescriptionConfiguration Options
Box shadowApply shadow styling to the component container.Pick a shadow color, adjust properties, or define programmatically using fx.
PaddingMaintain consistent spacing inside the container.Default or None