<!--
{
  "documentType" : "article",
  "framework" : "TVML",
  "identifier" : "/documentation/TVML/ratingtemplate",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "ratingTemplate"
}
-->

# ratingTemplate

Displays a rating for an item.

## Overview

Use the `ratingTemplate` element to display a rating for an item. The following figure
shows the basic layout for a `ratingTemplate` page. The theme for the rating template
defaults to the system preference.

![Layout diagram showing a title area above a rating area.](images/com.apple.TVML/ratingtemplate-1.png)

### Main Elements

The following listing shows the main elements of the `ratingTemplate` element in
TVML format.

```xml
<document>
    <ratingTemplate>
        <title>…</title>
        <ratingBadge></ratingBadge>
    </ratingTemplate>
</document>
```

#### Element Descriptions

- [ratingBadge](/documentation/TVML/ratingbadge): The rating for the item.
- [title](/documentation/TVML/title): The title for the rated item.

### Example

The following listing shows the TVML for a `ratingTemplate` example. The example
displays a title and a set of rating badge images, such as stars. The filled rating
badge images indicate the current rating for that title. The value attribute indicates
that the example title has an 80 percent favorable rating, or 4 of 5 stars.

```xml
<document>
    <ratingTemplate>
        <title>WWDC Roadtrip</title>
        <ratingBadge value="0.8"></ratingBadge>
    </ratingTemplate>
</document>
```

The following figure shows the output for the above example:

![Screenshot showing a title and 4 of 5 rating stars filled in.](images/com.apple.TVML/ratingtemplate-2.png)

## Topics

### Valid TVML Attributes

[binding](/documentation/TVML/binding)

Associates information in a data item with an element.

[layoutDirection](/documentation/TVML/layoutdirection)

Specifies the direction in which text is displayed.

[prototype](/documentation/TVML/prototype)

Associates a data item type with an element.

[theme](/documentation/TVML/theme)

Sets the color scheme for an element.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)