Examples
@bind-Value is the number of filled stars.
Your review: 4 / 5 (click the current star again to clear)
Mask takes any daisyUI mask class, such as mask-heart; Max sets the count.
love=3 · score=7/10 · spice=2
ReadOnly shows a score without letting anyone change it.
Playground
<Rating Value="4" />API
<Rating>
DaisyBlazorParameters
- Color Color= Color.Warning
Fill color for the selected stars via bg-{token} (e.g. Color.Warning → bg-warning).
- Mask string= null
daisyUI mask class applied to each radio input (e.g. "mask-star-2", "mask-heart"). Defaults to "mask-star-2".
- Max int= 5
Number of stars to render. Defaults to 5.
- ReadOnly bool= false
When true the user cannot interact with the widget.
- Size Size= Size.Medium
Size of the rating widget: maps to rating-xs / (default) / rating-sm / rating-md / rating-lg / rating-xl.
- Value int= 0
Current rating value (1–Max). 0 means no selection.
- Class string= null
Extra CSS classes added to the rating wrapper.
- Style string= null
Inline styles applied to the rating wrapper.
Events
- ValueChanged EventCallback<
int> Raised when the user selects a star, or with 0 when they click the current star again to clear it.
From MudRating
Rating keeps MudRating's parameter names, so most markup moves over by
dropping the Mud prefix. See the migration guide for the shared enums, icons and services.