RadzenRating Class

A star rating input component that allows users to provide ratings by selecting a number of stars. RadzenRating displays an interactive or read-only star rating with configurable number of stars and keyboard accessibility. Displays a row of stars (or other symbols) that users can click to select a rating value. The value is an integer from 0 to the number of stars configured. Common uses include product reviews and ratings, user feedback and satisfaction surveys, content quality indicators, and service ratings. Supports keyboard navigation (arrow keys, Space/Enter) for accessibility. Use ReadOnly mode to display ratings without allowing user input.

Inheritance

Object

ComponentBase

RadzenComponent

FormComponent<int>

RadzenRating

Implements

IComponent

IHandleEvent

IHandleAfterRender

IRadzenFormComponent

Inherited Members

FormComponent<int>.SetParametersAsync

FormComponent<int>.Dispose

FormComponent<int>.GetValue

FormComponent<int>.OnContextMenu

FormComponent<int>.GetClassList

FormComponent<int>.FocusAsync

FormComponent<int>.Name

FormComponent<int>.TabIndex

FormComponent<int>.Placeholder

FormComponent<int>.Disabled

FormComponent<int>.EditContext

FormComponent<int>.Form

FormComponent<int>.ValueChanged

FormComponent<int>.HasValue

FormComponent<int>.IsBound

FormComponent<int>.Value

FormComponent<int>.Change

FormComponent<int>.FieldIdentifier

FormComponent<int>.ValueExpression

FormComponent<int>.FormFieldContext

FormComponent<int>.CurrentPlaceholder

FormComponent<int>._value

RadzenComponent.OnMouseEnter

RadzenComponent.OnMouseLeave

RadzenComponent.GetCssClass

RadzenComponent.GetId

RadzenComponent.Debounce

RadzenComponent.OnInitialized

RadzenComponent.OnAfterRenderAsync

RadzenComponent.RaiseContextMenu

RadzenComponent.RaiseMouseEnter

RadzenComponent.AddContextMenu

RadzenComponent.RaiseMouseLeave

RadzenComponent.OnBecameInvisible

RadzenComponent.Attributes

RadzenComponent.Element

RadzenComponent.MouseEnter

RadzenComponent.MouseLeave

RadzenComponent.ContextMenu

RadzenComponent.Culture

RadzenComponent.DefaultCulture

RadzenComponent.Style

RadzenComponent.Visible

RadzenComponent.UniqueID

RadzenComponent.JSRuntime

RadzenComponent.IsJSRuntimeAvailable

RadzenComponent.Reference

RadzenComponent.CurrentStyle

ComponentBase.OnInitializedAsync

ComponentBase.OnParametersSet

ComponentBase.OnParametersSetAsync

ComponentBase.StateHasChanged

ComponentBase.ShouldRender

ComponentBase.OnAfterRender

ComponentBase.InvokeAsync

ComponentBase.DispatchExceptionAsync

ComponentBase.RendererInfo

ComponentBase.Assets

ComponentBase.AssignedRenderMode

Namespace: Radzen.Blazor

Assembly: Radzen.Blazor.dll

Syntax

public class RadzenRating : FormComponent<int>, IComponent, IHandleEvent, IHandleAfterRender, IRadzenFormComponent

Examples

Basic 5-star rating:

<RadzenRating @bind-Value=@rating />

Custom number of stars with change event:

<RadzenRating @bind-Value=@userRating Stars="10" Change=@(args => Console.WriteLine($"Rated: {args} out of 10")) />

Read-only rating display:

<RadzenRating Value=@product.AverageRating Stars="5" ReadOnly="true" />
<RadzenText>@product.AverageRating out of 5 stars</RadzenText>

Constructors

RadzenRatinglink

A star rating input component that allows users to provide ratings by selecting a number of stars. RadzenRating displays an interactive or read-only star rating with configurable number of stars and keyboard accessibility. Displays a row of stars (or other symbols) that users can click to select a rating value. The value is an integer from 0 to the number of stars configured. Common uses include product reviews and ratings, user feedback and satisfaction surveys, content quality indicators, and service ratings. Supports keyboard navigation (arrow keys, Space/Enter) for accessibility. Use ReadOnly mode to display ratings without allowing user input.

Declaration
public RadzenRating()

Properties

ClearAriaLabellink

Gets or sets the accessible label text for the clear rating action. Used by screen readers to announce the clear/reset rating button functionality.

Declaration
public string ClearAriaLabel { get; set; }
Property Value
Type Description
stringGets or sets the accessible label text for the clear rating action. Used by screen readers to announce the clear/reset rating button functionality.

RateAriaLabellink

Gets or sets the accessible label text template for rating actions. Used by screen readers to announce each star's rating value (e.g., "Rate 3 stars").

Declaration
public string RateAriaLabel { get; set; }
Property Value
Type Description
stringGets or sets the accessible label text template for rating actions. Used by screen readers to announce each star's rating value (e.g., "Rate 3 stars").

ReadOnlylink

Gets or sets whether the rating is read-only and cannot be changed by user interaction. When true, the stars display the current rating but cannot be clicked or modified. Useful for displaying ratings without allowing users to change them (e.g., showing product ratings).

Declaration
public bool ReadOnly { get; set; }
Property Value
Type Description
boolGets or sets whether the rating is read-only and cannot be changed by user interaction. When true, the stars display the current rating but cannot be clicked or modified. Useful for displaying ratings without allowing users to change them (e.g., showing product ratings).

Starslink

Gets or sets the total number of stars to display in the rating component. The value can range from 0 to this number. Common values are 5 or 10.

Declaration
public int Stars { get; set; }
Property Value
Type Description
intGets or sets the total number of stars to display in the rating component. The value can range from 0 to this number. Common values are 5 or 10.

Methods

BuildRenderTreelink

Declaration
protected override void BuildRenderTree(Rendering.RenderTreeBuilder __builder)
Parameters
Type Name Description
Rendering.RenderTreeBuilder __builder

GetComponentCssClasslink

Declaration
protected override string GetComponentCssClass()
Returns
Type Description
string
An error has occurred. This app may no longer respond until reloaded. Reload 🗙