> For the complete documentation index, see [llms.txt](https://docs.flatredball.com/gum/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.flatredball.com/gum/gum-tool/gum-elements/general-properties/max-height.md).

# Max Height

## Introduction

The `Max Height` variable sets the maximum height in pixels. This value is applied after all other layout so it can be used to overwrite automatically-assigned height.

By default this value is `<NULL>` which means there is no `Max Height`.

<figure><img src="https://2695663588-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_fzQmxQ1VeUFHcoo2c%2Fuploads%2Fgit-blob-8536a06a948cb92030b7aeeb3e1c5fabfeb22f45%2F13_06%2025%2005.gif?alt=media" alt=""><figcaption><p>A ColoredRectangle with no <code>Max Height</code></p></figcaption></figure>

If `Max Height` is assigned (not `<NULL>`), then the effective height cannot be larger than the `Max Height` value. The following animation shows that height is limited to a `Max Height` of `100`.

<figure><img src="https://2695663588-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_fzQmxQ1VeUFHcoo2c%2Fuploads%2Fgit-blob-81c6c26050d1a10f3312d8ff11bc816507289ef7%2F13_06%2025%2049.gif?alt=media" alt=""><figcaption><p><code>Max Height</code> set to <code>100</code> limits the ColoredRectangle's height</p></figcaption></figure>

Notice that the `Height` variable can still be set to a value larger than the `Max Height`, but it does not apply visually.

`Max Height` can also be used if `Height Units` is set to values other than `Absolute`. For example, `Max Height` can be used to limit the height of a ColoredRectangle when `Height Units` is `Relative to Parent`.

<figure><img src="https://2695663588-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_fzQmxQ1VeUFHcoo2c%2Fuploads%2Fgit-blob-4157507a39399846cfb8e62311c9ced5fb0bd8de%2F13_06%2030%2056.gif?alt=media" alt=""><figcaption><p>Rectangle's height limited by its <code>Max Height</code> of <code>100</code></p></figcaption></figure>

## Max Height and Relative to Children

Note that Max Height can prevent a container from growing according to its children. For more information, see the [Relative to Children Height Units page](/gum/gum-tool/gum-elements/general-properties/height-units.md#relative-to-children).

A container with a `Top to Bottom Stack` grows to its `Max Height` when its children need more space. The child that crosses the max extends past the container's bottom edge. If the container also has `Wraps Children` checked, it stops at the bottom edge of the last child that fits, since the next child moves to a new column. For more information see the [Children Layout](/gum/gum-tool/gum-elements/container/children-layout.md#stacking-and-container-height-units-and-width-units) page.

{% hint style="warning" %}
**Breaking change in November 2026:** Before this version, a stack without `Wraps Children` stopped growing at the last child that fit under its max, the same as a wrapping stack, so it could end up smaller than its max. Available in November 2026, or now if building Gum from source. For more information see [Migrating to 2026 November](/gum/gum-tool/upgrading/migrating-to-2026-november.md).
{% endhint %}


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.flatredball.com/gum/gum-tool/gum-elements/general-properties/max-height.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
