> Markdown version of [Spacing & Alignment](https://vaadin.com/docs/next/tools/copilot/features/spacing-and-alignment). Section index: [llms.txt](https://vaadin.com/docs/next/tools/llms.txt)

# Spacing & Alignment

A layout’s badge has switches for its padding and for the gap between its components, and a button for its alignment. Copilot writes the change to your Java code.

Pad the buttons' layout and center the view

1. Select a layout, here the one around the buttons: click Save and press `←` for its parent. The layout’s badge has the **Pad** and **Gap** switches, and **Alignment**.

   [![Your browser does not support the video tag.](../../../vaadin/videos/copilot/spacing-and-alignment/01-select.jpg)](../../../vaadin/videos/copilot/spacing-and-alignment/01-select.mp4)

2. Turn **Pad** on. The layout gets padding around its buttons, and Copilot writes it to ContactView\.java.

   [![Your browser does not support the video tag.](../../../vaadin/videos/copilot/spacing-and-alignment/02-padding.jpg)](../../../vaadin/videos/copilot/spacing-and-alignment/02-padding.mp4)

3. Click beside the form to select the view, which is a vertical layout too. In **Alignment**, choose to align its components to the center: the title, the form and the buttons move to the middle.

   [![Your browser does not support the video tag.](../../../vaadin/videos/copilot/spacing-and-alignment/03-align.jpg)](../../../vaadin/videos/copilot/spacing-and-alignment/03-align.mp4)

## <a id="more-options"></a>More Options

**Alignment** also has **Justify**, which places the components along the layout’s direction, and **Wrap**, which lets them continue on a new row or column.
