Articles in this section

How to change the shape of a rating items in .NET MAUI Rating?

In .NET MAUI Rating (SfRating), you can change the shape of the rating item by using the RatingShape property. There are various rating shapes available, such as Star, Heart, Circle, Diamond, and Custom. The default rating shape of the Rating control is Star.

XAML

<ContentPage.Content>
        <rating:SfRating Value="3" RatingShape="Diamond"/>
</ContentPage.Content>

C#

SfRating rating = new SfRating();
rating.Value = 3;
rating.RatingShape = RatingShape.Diamond;

OUTPUT

customrating.png

Custom Shape
You can also change a custom rating shape by setting the RatingShape to Custom and providing a custom Path.

XAML

<ContentPage.Content>
       <rating:SfRating Value="3"
                        ItemSize = "36"
                        RatingShape="Custom"
                        Path="M17.5 35.5C19.9063 35.5 21.875 33.8846 21.875  31.9103H13.125C13.125 33.8846 15.0719 35.5 17.5 35.5ZM30.625 24.7308V15.7564C30.625 10.2462 27.0375 5.63334 20.7812 4.41282V3.19231C20.7812 1.70256 19.3156 0.5 17.5 0.5C15.6844 0.5 14.2188 1.70256 14.2188 3.19231V4.41282C7.94063 5.63334 4.375 10.2282 4.375 15.7564V24.7308L0 28.3205V30.1154H35V28.3205L30.625 24.7308Z"/>                      
</ContentPage.Content>

C#

SfRating rating = new SfRating();
rating.Value = 3;
rating.ItemSize = 36;
rating.RatingShape = RatingShape.Custom;
rating.Path = "M17.5 35.5C19.9063 35.5 21.875 33.8846 21.875 31.9103H13.125C13.125 33.8846 15.0719 35.5 17.5 35.5ZM30.625 24.7308V15.7564C30.625 10.2462 27.0375 5.63334 20.7812 4.41282V3.19231C20.7812 1.70256 19.3156 0.5 17.5 0.5C15.6844 0.5 14.2188 1.70256 14.2188 3.19231V4.41282C7.94063 5.63334 4.375 10.2282 4.375 15.7564V24.7308L0 28.3205V30.1154H35V28.3205L30.625 24.7308Z";          

OUTPUT

bellimg.png

Conclusion
I hope you enjoyed learning how to change the shape of a rating item in .NET MAUI Rating (SfRating).

You can refer to our .NET MAUI Rating feature tour page to learn about its other groundbreaking feature representations. You can explore our .NET MAUI Rating documentation to understand how to present and manipulate data.

For current customers, you can check out our .NET MAUI components from the License and Downloads page. If you are new to Syncfusion®, try our 30-day free trial to check out our .NET MAUI Rating and other .NET MAUI components.

Please let us know in the comments section below if you have any queries or require clarification. You can also contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Access denied
Access denied