---
title: Align elements and make your UI fit every screen
product: Unity Spark
canonical: https://docs.unity.com/en-us/unity-spark/create/build/ui-editor/align-anchor-elements
last_updated: 2026-12-01
generated_at: 2026-12-01T21:09:19.343Z
locale: en-us
---

# Align elements and make your UI fit every screen

> Line up and space UI elements, group and fit them automatically, set anchors, and preview your UI on different screen shapes in Unity Spark.

Align and space elements so your screens are tidy, then set anchors so each element stays where it belongs when the screen size changes. For more information about anchors, refer to [Anchors](/unity-spark/create/build/ui-editor/ui-editor-concepts.md#anchors).

## Align and space elements

The toolbar at the top of the **UI Editor** has tools to snap, align, and distribute elements:

* **Snap** (magnet icon) snaps elements to alignment guides as you drag. Hold **Ctrl** (macOS: **Cmd**) while dragging to temporarily enable or disable snapping.
* **Align** aligns the left edges, centers, right edges, tops, or bottoms of two or more selected elements.
* **Distribute** spaces three or more selected elements evenly, horizontally or vertically.

For the full list of top toolbar tools, refer to [Top toolbar](/unity-spark/create/build/ui-editor/ui-editor-window-reference.md#top-toolbar).

## Set anchors

To set anchors:

1. Select one or more elements.
2. In the [Inspector window](/unity-spark/create/build/components/inspector-window-reference.md), open **Anchor presets** next to **Anchor**.
3. Select a preset. The following presets suit common layouts:
   * For a score in the top-left corner, anchor the score to the top-left.
   * For a pause button in the top-right corner, anchor the pause button to the top-right.
   * For a full-screen background, stretch in both directions.

To also set the pivot, hold **Shift** when you select a preset. To also move the element to that spot, hold **Alt** (macOS: **Option**).

To set each element's anchor automatically from where you place, move, or resize it, enable **Auto-anchor** in the **UI Editor**'s top toolbar.

## Group and fit elements

To arrange elements automatically, add one of the following [components](/unity-spark/create/build/components/about-components.md) to their parent element with **Add Component** in the **Inspector** window.

| **Component**             | **Description**                                                                                               |
| :------------------------ | :------------------------------------------------------------------------------------------------------------ |
| **HorizontalLayoutGroup** | Arranges the child elements in a row, with **Spacing** and **Padding**.                                       |
| **VerticalLayoutGroup**   | Arranges the child elements in a column, with **Spacing** and **Padding**.                                    |
| **GridLayoutGroup**       | Arranges the child elements in a grid of cells of the same size, such as an inventory.                        |
| **ContentSizeFitter**     | Resizes the element to fit its content, for example, to grow a list as you add items.                         |
| **AspectRatioFitter**     | Keeps the element's proportions when its size changes.                                                        |
| **LayoutElement**         | Sets an element's minimum, preferred, or flexible size inside a layout group, or leaves it out of the layout. |

To change several elements together, use the following components.

| **Component**              | **Description**                                                                                      |
| :------------------------- | :--------------------------------------------------------------------------------------------------- |
| **CanvasGroup**            | Fades, hides, or disables an element and all the elements inside it, for example, to fade in a menu. |
| **Mask**                   | Shows the child elements only inside the shape of this element's graphic.                            |
| **Outline** and **Shadow** | Adds an outline or a drop shadow to text or an image.                                                |

## Preview different screen shapes

To check different screen shapes:

1. Select the aspect-ratio menu in the [Scene view](/unity-spark/create/build/scenes/scene-view/scene-window-reference.md)'s toolbar or the **UI Editor**'s top toolbar. Both menus share the same setting.
2. Select **Free**, **16:9**, **16:10**, **3:2**, **4:3**, **1:1**, or **9:16** (phone portrait), or add your own.

To view how your UI sits over the game, use **Camera display** in the **UI Editor**'s top toolbar to show one of your scene's cameras behind the UI.

## Additional resources

* [Introduction to game UI](/unity-spark/create/build/ui-editor/ui-editor-concepts.md)
* [Add and style UI elements](/unity-spark/create/build/ui-editor/add-style-elements.md)
* [UI Editor window reference](/unity-spark/create/build/ui-editor/ui-editor-window-reference.md)
