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

# grid

Arranges elements in a grid pattern.

## Overview

Items inside of the `grid` are displayed in a row that is bound by the size of the
screen. Items are automatically moved to another row after a row is filled. Here’s
an example of three `lockup` elements inside of a `grid` element.

```xml
<grid>
    <section>
        <lockup>
            <img src="http://localhost:9001/images/Car_Movie_250x375_A.png" width="182" height="274" />
            <title>Movie 1</title>
        </lockup>
        <lockup>
            <img src="http://localhost:9001/images/Car_Movie_250x375_B.png" width="182" height="274" />
            <title>Movie 2</title>
        </lockup>
        <lockup>
            <img src="http://localhost:9001/images/Car_Movie_250x375_C.png" width="182" height="274" />
            <title>Movie 3</title>
        </lockup>
    </section>
</grid>
```

### Subelements of grid

- [header](/documentation/TVML/header)
- [section](/documentation/TVML/section)

### Elements that Use grid

- [collectionList](/documentation/TVML/collectionlist)
- [relatedContent](/documentation/TVML/relatedcontent)

## Topics

### Valid TVML Styles

[margin](/documentation/TVML/margin)

Specifies the spacing around an element.

[padding](/documentation/TVML/padding)

Specifies the padding between the border and contents of an element.

[tv-interitem-spacing](/documentation/TVML/tv-interitem-spacing)

Specifies the spacing between child elements.

[tv-line-spacing](/documentation/TVML/tv-line-spacing)

Specifies the amount of space between lines of text.

### Valid TVML Attributes

[binding](/documentation/TVML/binding)

Associates information in a data item with an element.

[autoHighlight](/documentation/TVML/autohighlight)

Specifies that the element should initially be in focus.

[itemID](/documentation/TVML/itemid)

Mark elements for reuse during DOM updates.

[needsMoreThreshold](/documentation/TVML/needsmorethreshold)

Sets the amount of remaining screen lengths before firing the needs more event.

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