Object
Render an object with a subset of fields. Extends Base.
Interactive Demo
Example
Hello, world
const config = {
components: {
Example: {
fields: {
params: {
type: "object",
objectFields: {
title: { type: "text" },
},
},
},
render: ({ params }) => {
return <p>{params.title}</p>;
},
},
},
};
Params
Param | Example | Type | Status |
---|---|---|---|
type | type: "array" | "array" | Required |
objectFields | objectFields: { title: { type: "text" } } | Object | Required |
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: "array",
objectFields: {
title: { type: "text" },
},
},
},
// ...
},
},
};