---
title: Stack
framework: docc
role: symbol
role_heading: Directive
path: docc/stack
---

# Stack

Displays set of horizontally arranged groupings that contain text and media in a section on a tutorial page.

## Declaration

```swift
@Stack {
    @ContentAndMedia { ... }
}
```

## Overview

Overview Use the Stack directive to horizontally arrange between one and three groupings of text and media (images or videos) in a section on a tutorial page. @Tutorial(time: 30) {          ...          @Section(title: "Add a customization view") {         @ContentAndMedia {             Add the ability for users to customize sloths and select their powers.                          @Image(source: 01-creating-section2.png, alt: "An outline of a sloth surrounded by four power type icons. The power type icons are arranged in the following order, clockwise from the top: fire, wind, lightning, and ice.")         }                  @Stack {             @ContentAndMedia {                 ...             }

@ContentAndMedia {                             ...                         }

@ContentAndMedia {                 ...             }                  }                     ...       } } Example of a 1-column stack:

Example of a 2-column stack:

Example of a 3-column stack:

Contained Elements A stack contains the following items: Containing Elements The following items can include a stack: Section

## Topics

### Optional Directives

- [ContentAndMedia](docc/contentandmedia.md)

## See Also

### Customizing Page Layout

- [ContentAndMedia](docc/contentandmedia.md)
