Table of Contents

Class MudRating

Namespace
MudBlazor
Assembly
MudBlazor.dll

A component for collecting and displaying ratings.

public class MudRating : MudComponentBase, IComponent, IHandleEvent, IHandleAfterRender, IMudStateHasChanged
Inheritance
MudRating
Implements
Inherited Members
Extension Methods

Constructors

MudRating()

public MudRating()

Properties

ClassName

The CSS classes applied to this component.

protected string ClassName { get; }

Property Value

string

Color

The color of each item.

[Parameter]
[Category("Appearance")]
public Color Color { get; set; }

Property Value

Color

Remarks

Defaults to Default.

Disabled

Prevents the user from interacting with this rating and shows a disabled color.

[Parameter]
[Category("Behavior")]
public bool Disabled { get; set; }

Property Value

bool

Remarks

Defaults to false.

EmptyIcon

The icon displayed for unselected items.

[Parameter]
[Category("Appearance")]
public string EmptyIcon { get; set; }

Property Value

string

Remarks

Defaults to StarBorder.

EmptyIconColor

The color of the EmptyIcon for unselected items.

[Parameter]
[Category("Appearance")]
public Color? EmptyIconColor { get; set; }

Property Value

Color?

Remarks

Defaults to null.

FullIcon

The icon displayed for selected items.

[Parameter]
[Category("Appearance")]
public string FullIcon { get; set; }

Property Value

string

Remarks

Defaults to Star.

FullIconColor

The color of the FullIcon for selected items.

[Parameter]
[Category("Appearance")]
public Color? FullIconColor { get; set; }

Property Value

Color?

Remarks

Defaults to null.

HoveredValueChanged

Occurs when MudBlazor.MudRating.HoveredValue has changed.

[Parameter]
public EventCallback<int?> HoveredValueChanged { get; set; }

Property Value

EventCallback<int?>

Remarks

Defaults to null.

MaxValue

The number of MudRatingItem items to display.

[Parameter]
[Category("Behavior")]
public int MaxValue { get; set; }

Property Value

int

Remarks

Defaults to 5.

Name

The name of this input.

[Parameter]
[Category("Behavior")]
public string Name { get; set; }

Property Value

string

Remarks

Defaults to a new Guid.

RatingItemsClass

The CSS classes to apply to each MudRatingItem.

[Parameter]
[Category("Appearance")]
public string? RatingItemsClass { get; set; }

Property Value

string

Remarks

Defaults to null. Multiple classes must be separated by spaces.

RatingItemsStyle

The CSS styles to apply to each MudRatingItem.

[Parameter]
[Category("Appearance")]
public string? RatingItemsStyle { get; set; }

Property Value

string

Remarks

Defaults to null.

ReadOnly

Prevents this rating from being changed.

[Parameter]
[Category("Behavior")]
public bool ReadOnly { get; set; }

Property Value

bool

Remarks

Defaults to false.

Ripple

Shows a ripple effect when an item is clicked.

[Parameter]
[Category("Appearance")]
public bool Ripple { get; set; }

Property Value

bool

Remarks

Defaults to true.

SelectedValue

The currently selected value.

[Parameter]
[Category("Data")]
public int SelectedValue { get; set; }

Property Value

int

Remarks

Defaults to 0. Must be equal or less than MaxValue.

SelectedValueChanged

Occurs when SelectedValue has changed.

[Parameter]
public EventCallback<int> SelectedValueChanged { get; set; }

Property Value

EventCallback<int>

Size

The size of the FullIcon and EmptyIcon icons.

[Parameter]
[Category("Appearance")]
public Size Size { get; set; }

Property Value

Size

Remarks

Defaults to Medium.

Methods

BuildRenderTree(RenderTreeBuilder)

protected override void BuildRenderTree(RenderTreeBuilder __builder)

Parameters

__builder RenderTreeBuilder

HandleKeyDownAsync(KeyboardEventArgs)

Occurs when a key is pressed.

protected Task HandleKeyDownAsync(KeyboardEventArgs keyboardEventArgs)

Parameters

keyboardEventArgs KeyboardEventArgs

The pressed key information.

Returns

Task

Remarks

Has no effect if Disabled or ReadOnly is true.
The supported keyboard keys are: ArrowRight (increase value) and ArrowLeft (decrease value).

See Also