Rating Blazor API

Rating Properties

NameTypeDefaultDescription
DisabledboolfalsePrevents any user interaction with the element, making it unresponsive to mouse, keyboard, and touch events such as clicks, focus, or input. The element will appear visually inactive and will not trigger any associated event handlers.
UnlockKeystring""Gets or sets the unlockKey property, which serves as the credential required to unlock and activate the product’s full functionality.
Localestring"en"Specifies or retrieves the current language setting. This property determines which localized set of messages (defined in the messages property) will be used for display and communication. Use this property to dynamically change the language of the interface by updating it in conjunction with the messages object.
MaxintSpecifies the total number of stars to display in the rating component. This value controls how many individual star icons are shown, allowing users to select a rating between 1 and the specified number.
MessagesobjectN/ASpecifies or retrieves an object containing the localized strings used by the element. This property allows you to define text labels, messages, or other UI strings that can be translated based on the user's language or region. It is typically used together with the locale property to display the appropriate translations for different locales.
Namestring""Specifies the name attribute of the element, which is used as the key when the form data is submitted. This allows the value of the element to be identified and processed on the server side.
RightToLeftboolfalseSets or retrieves a value that specifies whether the element's text direction and alignment are configured for right-to-left (RTL) languages, such as Arabic or Hebrew. Enabling this option ensures that the element properly supports locales that use RTL scripts.
Themestring""Specifies the theme to be applied. The selected theme controls the visual appearance, including colors, fonts, and styling, of the element.
UnfocusableboolfalseWhen set to true, this property prevents the element from receiving keyboard focus, making it impossible for users to navigate to the element using the Tab key or similar methods.
ValueintSpecifies how many stars should be visually highlighted to indicate the current rating value. This number determines which stars appear filled or active in the rating component.

Rating Methods

NameTypeArgumentsDescription
GetValueintN/ARetrieve the current value assigned to the rating property, indicating the user's selected rating or the rating score for the item.
GetValueAsync()Task<int>'N/A'Gets the &quot;Value&quot; property as Task&lt;int&gt;.
Refreshvoid'N/A'Refreshes the Blazor Component. Performs a layout of the HTML Elements and recalculates the measurements.
Rendervoid'N/A'Re-renders the Blazor Component. This method will make a full re-render.
SetValuevoidint valueAssigns or updates the current rating value. This property determines the selected rating level, typically represented by a numeric value (e.g., 1 to 5), and can be used to display the user’s chosen rating or set a default rating programmatically.Args: int value - Sets the value of the rating
StateHasChangedvoid'N/A'Refreshes the state and Re-renders the Blazor Component, if necessary.

Rating Events

NameTypeDescriptionEvent Detail
OnChangeEventCallback<Event>This event is triggered whenever the user adjusts the slider to a new value, either by dragging the handle or using keyboard controls. It fires each time the slider's value is updated, allowing you to respond dynamically to user input and capture the current value in real time.dynamic value- A numeric value indicating the scroll position., dynamic oldValue- A numeric value indicating the previous scroll position.
Changedevent RatingChangedEventHandlerThis event is triggered whenever the user adjusts the slider to a new value, either by dragging the handle or using keyboard controls. It fires each time the slider's value is updated, allowing you to respond dynamically to user input and capture the current value in real time.RatingChangedEventArgs