> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pdfnoodle.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Loop

> The Loop component lets you easily repeat a layout based on dynamic data.

<img src="https://mintcdn.com/pdforge/rwoRLXXUvihWxlAY/images/components/image-1-23.png?fit=max&auto=format&n=rwoRLXXUvihWxlAY&q=85&s=eddeb56c3d8f13ce086e8b09c5617a75" alt="" width="305" height="169" data-path="images/components/image-1-23.png" />

When creating a Loop, first give it a title. This title becomes a variable that expects an array of objects in the payload. The Loop repeats your layout according to the number of items in this array.

#### **Example:**

If your layout is:

<img src="https://mintcdn.com/pdforge/rwoRLXXUvihWxlAY/images/components/-example-3.png?fit=max&auto=format&n=rwoRLXXUvihWxlAY&q=85&s=783f4b71081a1ba6983a4644f8f311b2" alt="" width="1683" height="721" data-path="images/components/-example-3.png" />

Your payload should look like this:

```json theme={null}
{
  "loop_title": [
    { "name": "John Doe", "picture_src": "https://img.here" },
    { "name": "Sophie Lorem", "picture_src": "https://img.here" }
  ]
}
```

This results in your layout repeating twice:

<img src="https://mintcdn.com/pdforge/rwoRLXXUvihWxlAY/images/components/image-1-24.png?fit=max&auto=format&n=rwoRLXXUvihWxlAY&q=85&s=8319469d8809cdad3c5eb240c7f299a9" alt="" width="387" height="270" data-path="images/components/image-1-24.png" />

### Stacking loops

You can also create nested loops by stacking them. This allows for more complex data structures.

#### **Example of a nested layout:**

<img src="https://mintcdn.com/pdforge/rwoRLXXUvihWxlAY/images/components/-example-of-a-nested-layout-1.png?fit=max&auto=format&n=rwoRLXXUvihWxlAY&q=85&s=f47b76b35cc1ad60698339212c780026" alt="" width="1246" height="567" data-path="images/components/-example-of-a-nested-layout-1.png" />

Expected payload for nested loops:

```json theme={null}
{
  "loop_title": [
    {
      "name": "John Doe",
      "picture_src": "https://img.here",
      "characteristics": [
        "characteristics1",
        "characteristics2",
        "characteristics3"
      ]
    },
    {
      "name": "Sophie Lorem",
      "picture_src": "https://img.here",
      "characteristics": [
        "characteristics1",
        "characteristics2",
        "characteristics3"
      ]
    }
  ]
}
```

Resulting on this final result:

<img src="https://mintcdn.com/pdforge/rwoRLXXUvihWxlAY/images/components/image-1-25.png?fit=max&auto=format&n=rwoRLXXUvihWxlAY&q=85&s=a4828342119bac0544d60cf6b8ee2cdb" alt="" width="809" height="595" data-path="images/components/image-1-25.png" />
