> For the complete documentation index, see [llms.txt](https://zoomuxd.gitbook.io/drift/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://zoomuxd.gitbook.io/drift/foundations/spacing.md).

# Spacing

## The Spacing System

All spacing for components and typography is done in increments of **4 pixels(4px Scale)**. This 4px value forms the basic unit of measurement for spacing.

**Not all elements will align to this scale, and that's OK**. The scale is meant as a helpful place to start by limiting the choice of arbitrary values. When you deviate, it's important to try to use multiples of 8 (or 4) as it will enable natural alignment.

![](/files/-LzHHrggayhO9pa-Qjng)

[**Typography**](/drift/foundations/typography.md#roboto-android) doesn’t use a traditional baseline grid. Instead, line heights are set in increments of 4px and spacing is measured from the edges of the text boxes.

## Exceptions

## 🧑🏻‍💻 Usage Guidelines

| PX   | Naming           |
| ---- | ---------------- |
| 2px  | Extra Tight      |
| 4px  | Tight            |
| 8px  | Base tight       |
| 12px | Base             |
| 16px | Base Loose       |
| 24px | Loose            |
| 32px | Extra Loose      |
| 36px | Very Extra Loose |
| 48px | --               |

### Spacing Token

{% tabs %}
{% tab title="🍎 iOS" %}

```swift
 public enum Padding: CGFloat {
        case k48 = 48
        case k36 = 36
        case k32 = 32
        case k24 = 24
        case k16 = 16
        case k12 = 12
        case k8 = 8
        case k4 = 4
        case k2 = 2
    }
```

{% endtab %}

{% tab title="Second Tab" %}

{% endtab %}
{% endtabs %}


---

# 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:

```
GET https://zoomuxd.gitbook.io/drift/foundations/spacing.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
