---
url: https://www.questpdf.com/api-reference/debug-area.md
---

# Debug area

The DebugArea element helps you visually debug document layouts by drawing a labeled box around its content.
This aids in understanding spacing, alignment and pinpointing specific sections of the document during development.

::: tip
For enhanced development and debugging experience, please consider using [the QuestPDF Companion App](/companion/usage.md).
:::

## API

You can specify text and color to better distinguish between various debug elements:

```csharp{2}
container
    .DebugArea("Grid example", Colors.Blue.Medium)
    // content
```

It is also possible to skip the color (it is red by default), and even the label:

```csharp
.DebugArea("Grid example")
.DebugArea()
```

::: tip
Learn more about supported color formats and predefined color palettes in the [Colors](/concepts/colors.md) section.
:::

## Example

```csharp{5}
container
    .Width(250)
    .Height(250)
    .Padding(25)
    .DebugArea("Grid example", Colors.Blue.Medium)
    .Column(column =>
    {
        column.Spacing(5);

        foreach (var _ in Enumerable.Range(0, 3))
        {
            column.Item().Row(row =>
            {
                row.Spacing(5);

                foreach (var _ in Enumerable.Range(0, 3))
                    row.RelativeItem().Height(50).Placeholder();
            });
        }
    });
```

![example](/api-reference/debug-area.webp)
