# 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="https://2695663588-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_fzQmxQ1VeUFHcoo2c%2Fuploads%2Fgit-blob-5c7d17a9d097a3bb1c0471628e24b9c1822407d2%2F01_08%2028%2012.png?alt=media" 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="https://2695663588-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_fzQmxQ1VeUFHcoo2c%2Fuploads%2Fgit-blob-04eb57159dd8e380d24bfe8153ac27bad37545b9%2F01_08%2029%2030.png?alt=media" 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="https://2695663588-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_fzQmxQ1VeUFHcoo2c%2Fuploads%2Fgit-blob-159b84560db21546fe62c60ded1df7d87b4b45bd%2F01_08%2030%2019.png?alt=media" 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="https://2695663588-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_fzQmxQ1VeUFHcoo2c%2Fuploads%2Fgit-blob-fc20e7c685ff01f9b6de76629d4006c8b2ccecae%2F01_08%2030%2054.png?alt=media" 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="https://2695663588-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_fzQmxQ1VeUFHcoo2c%2Fuploads%2Fgit-blob-6879969d0e19ec868d60b5f33661917be3b3558f%2F01_08%2031%2031.png?alt=media" 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="https://2695663588-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_fzQmxQ1VeUFHcoo2c%2Fuploads%2Fgit-blob-5b1e1d5fb12500e3347c3cbcc1382b5afeddd696%2F01_08%2032%2019.png?alt=media" 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="https://2695663588-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_fzQmxQ1VeUFHcoo2c%2Fuploads%2Fgit-blob-9354ae124bfa7ce3646b756c835c15acd0af9f53%2F01_08%2031%2050.png?alt=media" 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="https://2695663588-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_fzQmxQ1VeUFHcoo2c%2Fuploads%2Fgit-blob-862797f3beec10e84b7aa58ca1602990a6b7e107%2F01_08%2032%2037.png?alt=media" 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="https://2695663588-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_fzQmxQ1VeUFHcoo2c%2Fuploads%2Fgit-blob-99c0a0a4b144f822a1c8a3f2f4fd08e22510eef8%2F01_08%2040%2013.png?alt=media" alt=""><figcaption></figcaption></figure>

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