Data

An object produced by Puck describing the shape of content.

{
  "content": [
    {
      "type": "HeadingBlock",
      "props": {
        "id": "HeadingBlock-1234",
        "title": "Hello, world"
      }
    }
  ],
  "root": { "props": { "title": "Puck Example" } },
  "zones": {}
}

Params

ParamExampleTypeStatus
contentcontent: []ArrayRequired
rootroot: { props: { title: "My page" } }ObjectRequired
zoneszones: { "HeadingBlock-123:zone": [] }Object-

content

An array containing an object for each component in the main content region.

content[*]

Params

ParamExampleTypeStatus
typetype: "HeadingBlock"StringRequired
propsprops: { title: "Hello, world" }ObjectRequired
readOnlyreadOnly: { title: true }Object-

Required params

content[*].type

The type of the component, which tells Puck to run the render() method for the component of the same key.

content[*].props

The props stored based on the component config that Puck will pass to the render() method for the component of the same key.

{
  "content": [
    {
      "type": "HeadingBlock",
      "props": {
        "id": "HeadingBlock-1234",
        "title": "Hello, world"
      }
    }
  ],
  "root": {},
  "zones": {}
}

Optional params

content[*].readOnly

An object describing which fields are set to read-only.

{
  "content": [
    {
      "type": "HeadingBlock",
      "props": {
        "id": "HeadingBlock-1234",
        "title": "Hello, world"
      },
      "readOnly": {
        "title": true
      }
    }
  ],
  "root": {},
  "zones": {}
}

root

An object describing data for the root config.

Params

ParamExampleTypeStatus
propsprops: { title: "Hello, world" }Object-
readOnlyreadOnly: { title: true }Object-

Optional params

root.props

The props stored based on the component config that Puck will pass to the render() method for the root config.

{
  "content": [],
  "root": { "props": { "title": "Puck Example" } },
  "zones": {}
}
root.readOnly

An object describing which fields are set to read-only.

{
  "content": [],
  "root": {
    "readOnly": {
      "title": true
    }
  },
  "zones": {}
}

zones

An object describing nested content regions for each DropZone.

zones[zoneKey]

An array describing the content for a particular region. Shares a shape with content.

zoneKey is a compound of the component id and DropZone zone.

{
  "content": [],
  "root": {},
  "zones": {
    "HeadingBlock-1234:my-content": [
      {
        "type": "HeadingBlock",
        "props": {
          "id": "HeadingBlock-1234",
          "title": "Hello, world"
        }
      }
    ]
  }
}