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

# menuBarTemplate

Creates a page with items along the top and related information below.

## Overview

Use the `menuBarTemplate` to display a list of selectable items across the top of
the screen. Users can move between menu bar items to change the information displayed
below the menu bar. The following figure shows the basic layout for a `menuBarTemplate`
page. The theme for the menu bar template defaults to the system preference.

![Layout diagram showing a menu bar area at the top and a related content area below.](images/com.apple.TVML/menubartemplate-1.png)

> Note: You can display up to seven items in the menu bar.

### Main Elements

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

```xml
<document>
    <menuBarTemplate>
        <menuBar>
            <menuItem>
                <title>…</title>
            </menuItem>
        </menuBar>
    </menuBarTemplate>
</document>
```

#### Element Descriptions

- [menuBar](/documentation/TVML/menubar): Menu items associated with the menu bar.
- [menuItem](/documentation/TVML/menuitem): Information about a single menu item.
- [title](/documentation/TVML/title): The text that describes the menu item.

### Example

The following listing shows the TVML for a `menuBarTemplate` example. The example
shows the menu bar along the top of the screen. Expand the controlling JavaScript
file in order to show content for each item in the menu bar. For more information,
see <doc://com.apple.documentation/documentation/tvmljs>.

```xml
<document>
    <menuBarTemplate>
        <menuBar>
            <menuItem id="navigation_top_movies" data-identifier="list">
                <title>Top Movies</title>
            </menuItem>
            <menuItem id="navigation_genres" data-identifier="index">
                <title>Genres</title>
            </menuItem>
            <menuItem id="navigation_search" data-identifier="search">
                <title>Search</title>
            </menuItem>
            <menuItem id="navigation_edit" data-identifier="edit">
                <title>Edit</title>
            </menuItem>
            <menuItem id="navigation_settings_add" data-identifier="add_settings">
                <title>Add Settings</title>
            </menuItem>
        </menuBar>
    </menuBarTemplate>
</document>
```

The following figure shows the output for the above example:

![Screenshot showing a menu bar with user options along the top of the screen.](images/com.apple.TVML/menubartemplate-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)