Demos About Radzen
Search Results for

    Show / Hide Table of Contents

    Class RadzenRating

    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
    IDisposable
    IRadzenFormComponent
    Inherited Members
    FormComponent<int>._value
    FormComponent<int>.SetParametersAsync(ParameterView)
    FormComponent<int>.Dispose()
    FormComponent<int>.GetValue()
    FormComponent<int>.OnContextMenu(MouseEventArgs)
    FormComponent<int>.GetClassList(string)
    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
    RadzenComponent.OnMouseEnter()
    RadzenComponent.OnMouseLeave()
    RadzenComponent.GetCssClass()
    RadzenComponent.GetId()
    RadzenComponent.Debounce(Func<Task>, int)
    RadzenComponent.OnInitialized()
    RadzenComponent.OnAfterRenderAsync(bool)
    RadzenComponent.RaiseContextMenu(MouseEventArgs)
    RadzenComponent.RaiseMouseEnter()
    RadzenComponent.AddContextMenu()
    RadzenComponent.RaiseMouseLeave()
    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(bool)
    ComponentBase.InvokeAsync(Action)
    ComponentBase.InvokeAsync(Func<Task>)
    ComponentBase.DispatchExceptionAsync(Exception)
    object.GetType()
    object.MemberwiseClone()
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    Namespace: Radzen.Blazor
    Assembly: Radzen.Blazor.dll
    Syntax
    public class RadzenRating : FormComponent<int>, IComponent, IHandleEvent, IHandleAfterRender, IDisposable, 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

    RadzenRating()

    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()
    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>

    Properties

    ClearAriaLabel

    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
    [Parameter]
    public string ClearAriaLabel { get; set; }
    Property Value
    Type Description
    string

    The ARIA label for clearing the rating. Default is "Clear".

    RateAriaLabel

    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
    [Parameter]
    public string RateAriaLabel { get; set; }
    Property Value
    Type Description
    string

    The ARIA label for rating actions. Default is "Rate".

    ReadOnly

    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
    [Parameter]
    public bool ReadOnly { get; set; }
    Property Value
    Type Description
    bool

    true if the rating is read-only; otherwise, false. Default is false.

    Stars

    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
    [Parameter]
    public int Stars { get; set; }
    Property Value
    Type Description
    int

    The total number of stars. Default is 5.

    Methods

    BuildRenderTree(RenderTreeBuilder)

    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
    protected override void BuildRenderTree(RenderTreeBuilder __builder)
    Parameters
    Type Name Description
    RenderTreeBuilder __builder
    Overrides
    ComponentBase.BuildRenderTree(RenderTreeBuilder)

    GetComponentCssClass()

    Gets the component CSS class.

    Declaration
    protected override string GetComponentCssClass()
    Returns
    Type Description
    string
    Overrides
    RadzenComponent.GetComponentCssClass()

    Implements

    IComponent
    IHandleEvent
    IHandleAfterRender
    IDisposable
    IRadzenFormComponent

    Introducing Radzen Blazor Studio

    Radzen Blazor Studio is a software development environment that empowers developers to design, build and deploy Blazor applications without the traditional hurdles. Write less code and get more done.

    Learn More

    Download Now
    Download Now
    In This Article
    Back to top Radzen Blazor Components, © 2018-2025 Radzen. Source Code licensed under MIT