Object

Render an object with a subset of fields. Extends Base.

Interactive Demo
Example

Debug: Data

{"root":{"props":{}},"content":[{"type":"Example","props":{"params":{"title":"Hello, world"},"id":"example"}}],"zones":{}}

Debug: UI

{"leftSideBarVisible":true,"rightSideBarVisible":true,"arrayState":{},"itemSelector":{"index":0},"componentList":{},"isDragging":false,"previewMode":"edit","viewports":{"current":{"width":360,"height":"auto"},"options":[],"controlsVisible":true},"field":{"focus":null}}

Debug: Other

  • Selected Item:

Hello, world

const config = {
  components: {
    Example: {
      fields: {
        params: {
          type: "object",
          objectFields: {
            title: { type: "text" },
          },
        },
      },
      render: ({ params }) => {
        return <p>{params.title}</p>;
      },
    },
  },
};

Params

ParamExampleTypeStatus
typetype: "array"”array”Required
objectFieldsobjectFields: { title: { type: "text" } }ObjectRequired

Required params

type

The type of the field. Must be "object" for Object fields.

const config = {
  components: {
    Example: {
      fields: {
        items: {
          type: "object",
          objectFields: {
            title: { type: "text" },
          },
        },
      },
      // ...
    },
  },
};

objectFields

Describe the fields for the object. Shares an API with fields.

Can include any field type, including nested object fields.

const config = {
  components: {
    Example: {
      fields: {
        items: {
          type: "object",
          objectFields: {
            title: { type: "text" },
          },
        },
      },
      // ...
    },
  },
};