> For the complete documentation index, see [llms.txt](https://docs.realmacsoftware.com/elements-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.realmacsoftware.com/elements-docs/using-elements/components/layout-components/container.md).

# Container

The Container component is the primary wrapper for grouping related components. It controls content width and alignment, backgrounds, overlays, spacing, borders, links, filtering, and how the Container behaves inside Flex and Grid layouts.

{% hint style="info" %}
Project-wide container widths can be set for each breakpoint in [Theme Studio → Screens](/elements-docs/using-elements/design-and-theming/theme-studio/screens.md).
{% endhint %}

{% embed url="<https://www.youtube.com/watch?v=wpMW6ysKqKk>" %}

### How to Use Container

You’ll find Container under **Layout** in the Components list.

1. Drag **Container** onto the page.
2. Add components to its drop zone.
3. Set the content width, height, alignment, and gap.
4. Add padding to create space inside the section and margin to position it externally.
5. Apply a background, overlay, border, or link if required.

### Component Settings

#### Tags and Filter

The **Tags** collection adds tag titles used by Filter and Filter Tags.

Enable **Filter** to make the Container a filterable item. Choose Parent or Custom grouping; Custom reveals a Group ID. The transition can be Dim, Zoom Out, or Slide.

#### Link

**To** can make the whole Container clickable. Do not use a Container link when it contains Buttons, links, form controls, or other interactive components.

#### Flexbox and Grid

**Type**

* **Default** — Uses normal layout behaviour.
* **Grid Item** — Exposes grid column, row, span, and placement controls.
* **Flex Item** — Exposes flex order, growth, shrink, basis, and self-alignment controls.

Standard and Advanced modes reveal the appropriate level of placement control. These settings apply only when the Container is inside the matching Grid or Flex parent.

#### Content Layout

**Width** offers Auto, Full, Screen, Breakpoint, or Theme Spacing. Breakpoint is the default. Theme Spacing reveals a value that defaults to 36.

**Height** offers the same modes and defaults to Auto. Its Theme Spacing value also defaults to 36.

**Align** controls the cross-axis position and **Justify** controls the main-axis position. Both offer Auto, Start, End, Centre, or Stretch and default to Centre.

**Gap** controls spacing between child components and defaults to 0.

#### Effects, Filters, and Transforms

Each group has a **To** setting:

* **Everything** — Applies to content and background. This is the default.
* **Background** — Applies only to the background layer.
* **Content** — Applies only to child content.

The remaining controls configure the selected effect, filter, or transform.

#### Background and Background Overlay

Background supports colour, image, gradient, SVG, and video styles where shown. Configure resources, colours, opacity, image positioning, gradient stops, or video options for the selected type.

Background Overlay adds a separate colour, gradient, image, or effect layer above the background and behind the content.

#### Advanced

**HTML Tag** changes the Container’s semantic wrapper. Choose an appropriate standard tag or enter a custom one.

The **Custom Attributes** collection adds Attribute and Value pairs to the Container’s HTML. Use valid attributes and avoid duplicating built-in controls such as ID and class.

### Tips and Best Practices

* **Use padding for internal space:** Margin separates the Container from surrounding components.
* **Use Auto margins deliberately:** Equal left and right Auto margins centre a fixed-width Container.
* **Keep structure meaningful:** Prefer semantic HTML tags when the Container represents a section, header, footer, or main region.
* **Apply one-off utility styles carefully:** For example, adding `blur-sm` under Advanced → CSS Classes blurs the Container and its contents. See the [Tailwind blur utilities](https://tailwindcss.com/docs/blur) and [Tailwind CSS documentation](https://tailwindcss.com/docs/).

### Related Components

* [Flex](/elements-docs/using-elements/components/layout-components/flex.md) — Arranges children in a row or column.
* [Grid](/elements-docs/using-elements/components/layout-components/grid.md) — Creates two-dimensional layouts.
* [Background](/elements-docs/using-elements/components/styling-and-effects/background.md) — Adds angled or fixed backgrounds.
* [Filter](/elements-docs/using-elements/components/data-and-organisation/filter.md) — Searches tagged Containers.

| Common Control                                                                                                     | Description                                                             |
| ------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------- |
| [Link](/elements-docs/using-elements/components/common-controls/link.md)                                           | Link to a page, resource, anchor, email address, or website.            |
| [Layout](/elements-docs/using-elements/components/common-controls/layout.md)                                       | Control positioning, stacking, visibility, overflow, and isolation.     |
| [Sizing](/elements-docs/using-elements/components/common-controls/sizing.md)                                       | Set width, height, and responsive size constraints.                     |
| [Spacing](/elements-docs/using-elements/components/common-controls/spacing.md)                                     | Add responsive margin and padding.                                      |
| [Typography & Text Styles](/elements-docs/using-elements/components/common-controls/typography-and-text-styles.md) | Control fonts, text spacing, decoration, colour, and semantic wrappers. |
| [Backgrounds](/elements-docs/using-elements/components/common-controls/backgrounds.md)                             | Apply colour, image, gradient, SVG, video, and hover backgrounds.       |
| [Transitions](/elements-docs/using-elements/components/common-controls/transitions.md)                             | Choose what animates and set its timing curve, duration, and delay.     |
| [Effects](/elements-docs/using-elements/components/common-controls/effects.md)                                     | Apply shadows, opacity, and hover effects.                              |
| [Filters](/elements-docs/using-elements/components/common-controls/filters.md)                                     | Apply blur, brightness, saturation, shadow, and backdrop effects.       |
| [Transforms](/elements-docs/using-elements/components/common-controls/transforms.md)                               | Scale, rotate, move, and skew components.                               |
| [Borders](/elements-docs/using-elements/components/common-controls/borders.md)                                     | Set border style, colour, opacity, width, radius, and hover states.     |
| [Advanced](/elements-docs/using-elements/components/common-controls/advanced.md)                                   | Add CSS classes and IDs, or change supported HTML tags.                 |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.realmacsoftware.com/elements-docs/using-elements/components/layout-components/container.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
