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

# alertTemplate

Displays important information to the user.

## Overview

Use the `alertTemplate` element to display important information, such as a message
telling the user to perform an action before continuing. At a minimum, provide a
description of the alert and a button so the user can take any required actions.
The following figure shows the basic layout for an `alertTemplate` page. The theme
for the alert template defaults to the system preference.

![Layout diagram showing title and description areas at the top, and a button area followed by a text area below.](images/com.apple.TVML/alerttemplate-1@2x.png)

### Main Elements

The following listing shows the main elements of the `alertTemplate` element in TVML
format:

```xml
<alertTemplate>
   <background>
      …
   </background>
   <title>…</title>
   <description>…</description>
   <button>
      <text>…</text>
   </button>
   <text>…</text>
</alertTemplate>
```

#### Element Descriptions

- [background](/documentation/TVML/background): Background elements, such as audio.
- [button](/documentation/TVML/button): A button that typically allows the user to dismiss the alert
  or to bring up a new template page. The button element contains a text element that
  shows the name of the button.
- [description](/documentation/TVML/description): The main text for the alert.
- [text](/documentation/TVML/text): A brief description of what the button does.
- [title](/documentation/TVML/title): The title of the alert, which should briefly communicate its
  purpose.

### Example

The following listing shows the TVML for an `alertTemplate` example:

```xml
<document>
   <alertTemplate>
      <title>Update Available</title>
      <description>Get the latest tvOS version</description>
      <button>
         <text>Update Now</text>
      </button>
      <button>
         <text>Cancel</text>
      </button>
   </alertTemplate>
</document>
```

The following figure shows the output for the above example:

![Screenshot prompting the user to update the Apple TV. Two buttons below the prompt allow the user to accept or cancel the update.](images/com.apple.TVML/alerttemplate-2.png)

## Topics

### Valid TVML Attributes

[autoHighlight](/documentation/TVML/autohighlight)

Specifies that the element should initially be in focus.

[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)