> 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/y-origin.md).

# Y Origin

## Introduction

The **Y Origin** variable controls the point which an object is positioned by. By default the **Y Origin** is **Top**. The **Y Origin** is shown visually as a white "X" in the editor.

## Top

The following image shows a [ColoredRectangle](/gum/gum-tool/gum-elements/coloredrectangle.md) with its **Y Origin** set to **Top**:

![ColoredRectangle with Top Y Origin](https://2695663588-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_fzQmxQ1VeUFHcoo2c%2Fuploads%2Fgit-blob-5c85a8f87b565d93835b477e6de48e80e669e540%2F25_19%2038%2016.png?alt=media)

## Center

The following image shows a ColoredRectangle with its **Y Origin** set to **Center**:

![ColoredRectangle with Center Y Origin](https://2695663588-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_fzQmxQ1VeUFHcoo2c%2Fuploads%2Fgit-blob-7f22f0e61d1aaa54340f7d8bb056877978169adb%2F25_19%2039%2018.png?alt=media)

## Bottom

The following image shows a ColoredRectangle with its **Y Origin** set to **Bottom**:

![ColoredRectangle with Bottom Y Origin](https://2695663588-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_fzQmxQ1VeUFHcoo2c%2Fuploads%2Fgit-blob-44a8e75b622ae4cb82a5326a98032b2e93cfac0c%2F25_19%2039%2056.png?alt=media)

## Baseline

The following shows a Text with its Y Origin set to Baseline:

<figure><img src="https://2695663588-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_fzQmxQ1VeUFHcoo2c%2Fuploads%2Fgit-blob-27ca3454de1c68695690fc6b1b0961003202a5e9%2F25_19%2042%2032.png?alt=media" alt=""><figcaption><p>Text with Baseline Y Origin</p></figcaption></figure>

Baseline refers to the bottom of the text for letters without descenders. For more information see the [Wikipedia Baseline page](https://en.wikipedia.org/wiki/Baseline_\(typography\)).

Baseline is often used to align fonts of different sizes. The following image shows two Text instances with different font sizes. Both are positioned by their baseline so their bottoms align properly (ignoring descenders, such as on the letter p and the comma).

<figure><img src="https://2695663588-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_fzQmxQ1VeUFHcoo2c%2Fuploads%2Fgit-blob-7e5711c92a3d072710c70b6d6fb080911bbbd10f%2Fimage%20(2)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1)%20(1).png?alt=media" alt=""><figcaption><p>50,000 xp aligned by baseline</p></figcaption></figure>

By contrast, the following image shows the same Text instances using bottom alignment.

<figure><img src="https://2695663588-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_fzQmxQ1VeUFHcoo2c%2Fuploads%2Fgit-blob-8b7b99c7ac1684c608fc50e96dc2b4aaabf5c7bb%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

## Y Origin in a Top to Bottom Stack

A child in a [Top to Bottom Stack](/gum/gum-tool/gum-elements/container/children-layout.md#top-to-bottom-stack) which is not the first child ignores its `Y Origin`, and the stack positions it as if its `Y Origin` were `Top`. This keeps it from overlapping its previous sibling. The first child in the stack uses its `Y Origin` normally, and `Y Origin` works normally for every child in a `Left to Right Stack`.

{% hint style="warning" %}
**Breaking change in November 2026:** Before this version, `Y Origin` applied to every child in a `Top to Bottom Stack`, so a `Center`, `Bottom`, or `Baseline` origin moved a child back over its previous sibling. 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/y-origin.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.
