New to Telerik UI for BlazorStart a free 30-day trial

A component that lets you capture and display a rating with keyboard, mouse, and hover interactions. Supports item count, selection and precision modes, disabled/readonly states, templates, ARIA labeling, and change callbacks.

Definition

Namespace:Telerik.Blazor.Components

Assembly:Telerik.Blazor.dll

Syntax:

C#
public class TelerikRating : BaseComponent, IComponent, IHandleEvent, IHandleAfterRender, IDisposable

Inheritance: objectComponentBaseBaseComponentTelerikRating

Implements: IComponentIDisposableIHandleAfterRenderIHandleEvent

Inherited Members BaseComponent.ShouldRender()BaseComponent.OnInitializedAsync()BaseComponent.Dispose()BaseComponent.InitLocalizer()BaseComponent.ThrowIfParameterIsNull(object, string)BaseComponent.HaveOptionsChanged(IDictionary<string, object>, IDictionary<string, object>)BaseComponent.GetClassString(params string[])BaseComponent.InvokeAsync<T>(string, params object[])BaseComponent.InvokeAsync<T>(string, CancellationToken, params object[])BaseComponent.InvokeVoidAsync(string, params object[])BaseComponent.InvokeVoidAsyncWithoutAwait(string, params object[])BaseComponent.InvokeComponentMethodAsync<T>(string, params object[])BaseComponent.InvokeComponentMethodAsync<T>(string, CancellationToken, params object[])BaseComponent.InvokeVoidComponentMethodAsync(string, params object[])BaseComponent.InvokeComponentVoidMethodAsync(string, object)BaseComponent.InvokeDisposeAsync()BaseComponent.StateHasChanged()BaseComponent.RootComponentBaseComponent.ClassComponentBase.OnInitialized()ComponentBase.OnParametersSetAsync()ComponentBase.OnAfterRender(bool)ComponentBase.InvokeAsync(Action)ComponentBase.InvokeAsync(Func<Task>)ComponentBase.DispatchExceptionAsync(Exception)ComponentBase.SetParametersAsync(ParameterView)...

Constructors

C#
public TelerikRating()

Methods

C#
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Parameters:__builderRenderTreeBuilder

Overrides: ComponentBase.BuildRenderTree(RenderTreeBuilder)

C#
protected override Task OnAfterRenderAsync(bool firstRender)
Parameters:firstRenderboolReturns:

Task

Overrides: BaseComponent.OnAfterRenderAsync(bool)

C#
protected override void OnParametersSet()

Overrides: ComponentBase.OnParametersSet()

Properties

[Accessibility] Describe the aria-label attribute for the component.

C#
[Parameter]
public string AriaLabel { get; set; }

[Accessibility] Describe the aria-labelledby attribute for the component.

C#
[Parameter]
public string AriaLabelledBy { get; set; }

Gets or sets the description used for the data-smart-paste attribute.

C#
[Parameter]
public string DataSmartPasteDescriptionAttribute { get; set; }

Defines whether the component should be rendered in a disabled state.

C#
[Parameter]
public bool Enabled { get; set; }

Enables WebMCP tool registration for this Rating. When true, Rating operations are exposed as tools discoverable by AI models through the browser. Default value is false.

C#
[Parameter]
public bool EnableWebMcpTools { get; set; }

Defines the interval for which the value should change on hover.

C#
[Parameter]
public int HoverThrottleInterval { get; set; }

The id of the component.

C#
[Parameter]
public string Id { get; set; }

Defines the Item Template of the component.

C#
[Parameter]
public RenderFragment<RatingItemTemplateContext> ItemTemplate { get; set; }

Adds a label next to the rating.

C#
[Parameter]
public string Label { get; set; }

Defines the maximum number of items for the component.

C#
[Parameter]
public double Max { get; set; }

Controls the precision mode of the component. Available options are: Half and Full.

C#
[Parameter]
public RatingPrecisionMode PrecisionMode { get; set; }

Provides configuration for WebMCP tools, such as a Name to distinguish this Rating from others on the same page.

C#
[Parameter]
public RenderFragment RatingSettings { get; set; }

[Accessibility] Defines whether the component should be rendered in a readonly state.

C#
[Parameter]
public bool ReadOnly { get; set; }

Controls the selection mode of the component. Available options are: Single and Continuous.

C#
[Parameter]
public RatingSelectionMode SelectionMode { get; set; }

Defines the value of the component.

C#
[Parameter]
public double Value { get; set; }
C#
[Parameter]
public EventCallback<double> ValueChanged { get; set; }