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

# stack

Groups and lays out elements vertically.

## Overview

The `stack` element groups elements together and lays them out vertically, starting
from the top of the containing element. Each element is placed directly underneath
the preceding element.

```xml
<stack>
    <title>WWDC Road Trip</title>
    <row>
        <text><badge src="resource://tomato-fresh"/> 99%</text>
        <text>1hr 54min</text>
        <text>Comedy</text>
        <text>2015</text>
        <badge src="resource://mpaa-pg" class="badge" />
        <badge src="resource://cc" class="badge" />
    </row>
    <description handlesOverflow="true">An aspiring developer gets a ticket to WWDC, but can't afford to fly there. Now they need to get across country in time for the keynote, and the only person who can help is their quirky roommate.</description>
    <text>Language information can go here</text>
    <row>
        <buttonLockup>
            <badge src="resource://button-preview" />
            <title>Preview</title>
        </buttonLockup>
        <buttonLockup type="buy">
            <text>$9.99</text>
            <title>Buy</title>
        </buttonLockup>
    </row>
</stack>
```

### Subelements of stack

- [description](/documentation/TVML/description)
- [ratingCard](/documentation/TVML/ratingcard)
- [reviewCard](/documentation/TVML/reviewcard)
- [row](/documentation/TVML/row)
- [subtitle](/documentation/TVML/subtitle)
- [text](/documentation/TVML/text)
- [title](/documentation/TVML/title)

### Elements that Use stack

- [banner](/documentation/TVML/banner)
- [shelf](/documentation/TVML/shelf)

## Topics

### Valid TVML Styles

[height](/documentation/TVML/element-shaping-height)

Specifies the height of an element.

[margin](/documentation/TVML/margin)

Specifies the spacing around an element.

[width](/documentation/TVML/element-shaping-width)

Specifies how wide an element is.

### Valid TVML Attributes

[binding](/documentation/TVML/binding)

Associates information in a data item with an element.

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