Skip to content
daisyBlazor

Rating

A row of stars (or any daisyUI mask) bound to an int from 0 to Max. Clicking the current star again clears it; ReadOnly turns it into a display.
Data input.ratingReplaces MudRating
Cover · <Rating>

Customer satisfaction

Acme Cloud

Examples

Binding

@bind-Value is the number of filled stars.

Your review: 4 / 5 (click the current star again to clear)

website/Examples/DataInput/RatingBasicExample.razor Source

Mask takes any daisyUI mask class, such as mask-heart; Max sets the count.

love=3 · score=7/10 · spice=2

website/Examples/DataInput/RatingMasksExample.razor Source

Read-only

ReadOnly shows a score without letting anyone change it.

Onboarding
Documentation
Billing page
website/Examples/DataInput/RatingReadOnlyExample.razor Source

Playground

Color Color
Size Size
<Rating Value="4" />

API

<Rating>

DaisyBlazor

Parameters

  • 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.

<MudRating> <Rating>
Something went wrong while running the docs. Reload