# .NET MAUI Shape Rating

The `RadShapeRating` component is designed for the simplest scenarios where an ordinary Rating component is required. `RadShapeRating` allows easy customization of the colors and shape of the default rating item.

## Shape Types

`RadShapeRating` exposes the `ItemShape` property of type `RadPathGeometry` which is used to define the shape of the rating items.

For a simple and fast setup, the Rating includes various simple shapes that can be used for rating items out of the box. This is accomplished through the `RadGeometry` class. The `RadGeometry` class exposes static properties that return predefined shapes.

> tip For more details on `RadPath` and `RadPathGeometry`, refer to the [Path Overview article](https://www.telerik.com/maui-ui/documentation/controls/path/overview).

## Geometries

The Rating supports the following geometry types:

* (Default) `Star`

![.NET MAUI Star Shape Rating](https://www.telerik.com/maui-ui/documentation/assets/c4f1d92fe650e1962e2c10f81a76498d/rating-star.png)

```XAML
<telerik:RadShapeRating AutomationId="defaultRating" />
```

* `Circle`

![.NET MAUI Circle Shape Rating](https://www.telerik.com/maui-ui/documentation/assets/9b98a229107ab699506d440562d79214/rating-circle.png)

```XAML
<telerik:RadShapeRating ItemShape="{x:Static telerik:RadGeometry.Circle}" AutomationId="circleRating" />
```

* `Diamond`

![.NET MAUI Diamond Shape Rating](https://www.telerik.com/maui-ui/documentation/assets/b7c989a4bda932f2ef5b1b14b71fae71/rating-diamond.png)

```XAML
<telerik:RadShapeRating ItemShape="{x:Static telerik:RadGeometry.Diamond}" AutomationId="diamondRating" />
```

* `Heart`

![.NET MAUI Heart Shape Rating](https://www.telerik.com/maui-ui/documentation/assets/638f973872397a0c18b99b852f0870e9/rating-heart.png)

```XAML
<telerik:RadShapeRating ItemShape="{x:Static telerik:RadGeometry.Heart}" AutomationId="heartRating" />
```

* Custom `RadPathGeometry` shape:

![.NET MAUI Custom Shape Rating](https://www.telerik.com/maui-ui/documentation/assets/fc8ffe044d5052c3de351f832c8262a0/rating-triangle.png)

```XAML
<telerik:RadShapeRating AutomationId="triangularRating">
    <telerik:RadShapeRating.ItemShape>
        <telerik:RadPathGeometry>
            <telerik:RadPathFigure StartPoint="0, 1">
                <telerik:RadLineSegment Point="1, 1" />
                <telerik:RadLineSegment Point="0.5, 0" />
                <telerik:RadLineSegment Point="0, 1" />
            </telerik:RadPathFigure>
        </telerik:RadPathGeometry>
    </telerik:RadShapeRating.ItemShape>
</telerik:RadShapeRating>
```

## Shapes Styling

You can control the visual appearance of the predefined shapes through the following styling settings:

* `ItemFill` (`Color`)—Specifies the color used to fill the rating item.
* `ItemStroke` (`Color`)—Defines the color used by the border around the geometry.
* `ItemStrokeThickness` (`double`)—Sets the width of the border around the geometry.
* `SelectedItemFill` (`Color`)—Defines the color used to fill the selected rating item.
* `SelectedItemStroke` (`Color`)—Sets the color used by the border around the selected geometry.
* `SelectedItemStrokeThickness` (`double`)—Specifies the width of the border around the selected geometry.

  ![.NET MAUI Rating Styling](https://www.telerik.com/maui-ui/documentation/assets/4c2eaccbaba370588659246b751fa3f1/rating-styles.png)

The following example shows how to set the shapes styling.

Define the `RadShapeRating`:

```XAML
<telerik:RadShapeRating AutomationId="styledRating" 
                             ItemFill="YellowGreen"
                             ItemStroke="YellowGreen"
                             SelectedItemFill="Pink"
                             SelectedItemStroke="Red" />
```

The following image shows the end result.

![.NET MAUI Rating Styling](https://www.telerik.com/maui-ui/documentation/assets/4c2eaccbaba370588659246b751fa3f1/rating-styles.png)

## See Also

* [Configuration of the Rating](https://www.telerik.com/maui-ui/documentation/controls/rating/configuration)
* [Templated Rating](https://www.telerik.com/maui-ui/documentation/controls/rating/templated-rating)
