Rating
Description
A component for collecting or displaying star ratings
The Rating component lets users express a value judgment on a 1-to-N star scale. It supports interactive selection, read-only display, and custom star counts.
API reference
public sealed class Rating : ComponentBase<Rating, HTMLElement>A star-rating component for collecting or displaying ratings.
- Namespace
- Tesserae
- Inheritance
- ComponentBase<Rating, HTMLElement> → Rating
Constructors
| Name | Description |
|---|---|
| Rating | Initializes a new Rating component. |
Properties
| Name | Description |
|---|---|
| Value | Gets or sets the current rating value (0 = unrated). |
| IsReadOnly | Gets or sets whether the rating is read-only. |
public int Value { get ; set ; }Gets or sets the current rating value (0 = unrated).
Methods
| Name | Description |
|---|---|
| Color | Sets a custom star color. |
| OnChange | Registers a callback for when the value changes. |
| SetValue | Sets the current value. |
| ReadOnly | Makes the rating read-only. |
| Render | Renders the component's root HTML element. |
public Rating OnChange(Action<int> onChange)Registers a callback for when the value changes.