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

# Dock

## Introduction

The Dock section of the Alignment tab is used to easily adjust the variables on an instance for common layouts. All Dock options adjust the dimensions of the current instance, and most also adjust the position.

<figure><img src="/files/xbyTuUEKHlzlPRACoatq" alt=""><figcaption><p>Dock buttons in the Alignment tab</p></figcaption></figure>

Keep in mind that docking an instance does not toggle a dock state, but rather modifies variables on the instance so that it has docking behavior. This distinction has the following consequences:

* Docking behavior can be achieved by manually modifying variables - this tab does not add any additional behavior which is not already available through the Variables tab.
* Docking cannot be undone by toggling the dock button, and pressing multiple dock buttons results in multiple dock variables being assigned which may result in undesirable behavior. To undo docking, use the CTRL+Z shortcut for undo.

## Dock types

This section lists all of the dock types, provides a visual examples, and lists which variables are modified.

### Top

<figure><img src="/files/sLOzllIru2o2eGCIYLmE" alt=""><figcaption></figcaption></figure>

<table data-full-width="false"><thead><tr><th>Variable</th><th>Value</th></tr></thead><tbody><tr><td>X</td><td>0</td></tr><tr><td>X Units</td><td>Pixels From Center</td></tr><tr><td>Y</td><td>0</td></tr><tr><td>Y Units</td><td>Pixels From Top</td></tr><tr><td>X Origin</td><td>Center</td></tr><tr><td>Y Origin</td><td>Top</td></tr><tr><td>Width</td><td>0</td></tr><tr><td>Width Units</td><td>Relative to Parent</td></tr></tbody></table>

### Left

<figure><img src="/files/rqv65BUhRB73Ddv7CJw9" alt=""><figcaption></figcaption></figure>

|              |                    |
| ------------ | ------------------ |
| X            | 0                  |
| X Units      | Pixels From Left   |
| Y            | 0                  |
| Y Units      | Pixels From Center |
| X Origin     | Left               |
| Y Origin     | Center             |
| Height       | 0                  |
| Height Units | Relative to Parent |

### Fill

<figure><img src="/files/NwYOtHWcjDk1HkMADc3e" alt=""><figcaption></figcaption></figure>

|              |                    |
| ------------ | ------------------ |
| X            | 0                  |
| X Units      | Pixels From Center |
| Y            | 0                  |
| Y Units      | Pixels From Center |
| X Origin     | Center             |
| Y Origin     | Center             |
| Width        | 0                  |
| Width Units  | Relative to Parent |
| Height       | 0                  |
| Height Units | Relative to Parent |

### Fill Vertically

<figure><img src="/files/m7hyVnjgGkSjXVqdC6Ww" alt=""><figcaption></figcaption></figure>

|              |                    |
| ------------ | ------------------ |
| Y            | 0                  |
| Y Units      | Pixels From Center |
| Y Origin     | Center             |
| Height       | 0                  |
| Height Units | Relative to Parent |

### Right

<figure><img src="/files/893RwXD81fWVuYcxm3Qf" alt=""><figcaption></figcaption></figure>

|              |                    |
| ------------ | ------------------ |
| X            | 0                  |
| X Units      | Pixels From Right  |
| Y            | 0                  |
| Y Units      | Pixels From Center |
| X Origin     | Right              |
| Y Origin     | Center             |
| Height       | 0                  |
| Height Units | Relative to Parent |

### Fill Horizontally

<figure><img src="/files/emwnn0TL7avy2pN4ps13" alt=""><figcaption></figcaption></figure>

|             |                    |
| ----------- | ------------------ |
| X           | 0                  |
| X Units     | Pixels From Center |
| X Origin    | Center             |
| Width       | 0                  |
| Width Units | Relative to Parent |

### Bottom

<figure><img src="/files/BbjHCYYvZ8qdw8t9uPhA" alt=""><figcaption></figcaption></figure>

|             |                    |
| ----------- | ------------------ |
| X           | 0                  |
| X Units     | Pixels From Center |
| Y           | 0                  |
| Y Units     | Pixels From Bottom |
| X Origin    | Center             |
| Y Origin    | Bottom             |
| Width       | 0                  |
| Width Units | Relative to Parent |

### Size to Children

<figure><img src="/files/UQTYulxTlLKp7eioS8qn" alt=""><figcaption></figcaption></figure>

|              |                      |
| ------------ | -------------------- |
| Width        | 0                    |
| Width Units  | Relative to Children |
| Height       | 0                    |
| Height Units | Relative to Children |


---

# 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.flatredball.com/gum/gum-tool/gum-elements/general-properties/dock.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.
