# Sized Box

The **Sized Box** is a simple, invisible widget that creates a box with a specific width and height. Its primary purpose is to add fixed-size gaps or spacing within layouts.

{% embed url="<https://youtu.be/AfcFB7VpHgc?si=rzegOV-PMqbYAyWf>" %}

Watch this on Youtube: <https://www.youtube.com/watch?v=AfcFB7VpHgc>

### Core Concept: Creating Space

Think of the Sized Box as a rigid, empty spacer. While other widgets like `Container` can have padding and margins, the Sized Box has only one job: to occupy a precise amount of space. This makes it the most efficient and straightforward way to add gaps between widgets in a `Column` or `Row`.

* In a `Column`, a Sized Box with a `Height` creates vertical space.
* In a `Row`, a Sized Box with a `Width` creates horizontal space.

<figure><img src="https://3626461507-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbhApDTL7kHrXte2TTtjs%2Fuploads%2Fgit-blob-d065cf58acbe9256c5b0f9f418cbb3b83cd141b4%2Fsized_box_intro.jpg?alt=media" alt="A diagram showing a Sized Box creating vertical space in a Column and horizontal space in a Row."><figcaption><p>Using a Sized Box to add vertical space in a Column and horizontal space in a Row.</p></figcaption></figure>

### Properties

<table><thead><tr><th width="176.25390625">Property</th><th>Description</th></tr></thead><tbody><tr><td><code>Width</code></td><td>The width of the box. Can be a fixed value in pixels (px).</td></tr><tr><td><code>Height</code></td><td>The height of the box. Can be a fixed value in pixels (px).</td></tr></tbody></table>

***

### Default Properties

The Sized Box is a highly specialized layout widget. Its core properties (`Width` and `Height`) define its entire function, so it does not use the standard Default Properties for styling (like `Background Color` or `Border`).

### Use Cases

The **Sized Box** widget is mainly for **spacing and fixed size**.

Use **Sized Box** when you want to:

* Add **space** between widgets
  * Vertical gap between texts, buttons, sections
  * Horizontal gap between icons or buttons in a row
* Give a widget a **fixed width/height**
  * Make icons, images, or custom widgets a consistent size
  * Create a fixed square or rectangle area
* Create an **empty placeholder**
  * Reserve space for content that may appear later
  * Keep layout alignment even when something is hidden
