Templates

By default, each Rating item is rendered with a star icon from the Kendo UI Web Font Icons.

To modify the default icon, use the ItemTemplate, SelectedTemplate, and HoveredTemplate properties.

Item Template

The item template specifies the template which is used for rendering the items of the Rating. If the SelectedTemplate is not specified, the Rating will use the default start icon for selected items. Therefore, when the ItemTemplate option is used, you have to specify the SelectedTemplate.

    @(Html.Kendo().Rating()
        .Name("rating")
        .Min(1)
        .Max(6)
        .Value(3)
        .ItemTemplate("<i class='k-icon k-i-heart-outline'></i>")
        .SelectedTemplate("<i class='k-icon k-i-heart'></i>")
    )

Selected Template

The selected template specifies the template which is used for rendering the selected state of the items. If the ItemTemplate is not specified, the Rating will use the default start icon for displaying the normal state of the items. Therefore, when the SelectedTemplate option is used, you have to specify the ItemTemplate.

When the Rating is in its half precision mode, use the same template for both the SelectedTemplate and HoveredTemplate options.

    @(Html.Kendo().Rating()
        .Name("rating")
        .Min(1)
        .Max(6)
        .Value(3)
        .ItemTemplate("<i class='k-icon k-i-heart-outline'></i>")
        .SelectedTemplate("<i class='k-icon k-i-heart'></i>")
    )

Hovered Template

The hovered template specifies the template which is used for rendering the hovered state of the items. If the ItemTemplate is not specified, the Rating will use the default start icon for displaying the normal and selected state of the items.

When the Rating is in its half precision mode, use the same template for both the SelectedTemplate and HoveredTemplate options.

    @(Html.Kendo().Rating()
        .Name("rating")
        .Min(1)
        .Max(6)
        .Value(3)
        .HoveredTemplate("<i class='k-icon k-i-heart'></i>")
    )

See Also

In this article
Not finding the help you need? Improve this article