SchemaObjectField
Displays the properties of a nested object inside an object box.
It is a thin wrapper: the component builds a BoxSchema of type object from the field's
properties and hands the rendering to SchemaObjectBox.
Example
<SchemaObjectField source="shipping_address" fields={addressSchema.properties} />
Props
| Name | Type | Default | Description |
|---|---|---|---|
source (required) | string | — | Path to the object on the record; the last segment becomes the box target |
fields (required) | FieldSchema[] | — | Schemas of the properties to render |
label | string | ReactElement | false | label from the schema | Heading of the object box |
caution
Plain object fields render nothing in a list — the dispatcher only mounts this component outside
list views. Expose the individual properties as separate columns if you need them in a list.
Schema mapping
type: "object" with properties and no more specific format:
{"name": "shipping_address", "type": "object",
"properties": [
{"name": "street", "type": "string"},
{"name": "city", "type": "string"},
{"name": "zip", "type": "string"}
]}
- Python
- Ruby
A nested serializer becomes an object field — see Nested serializers:
class AddressSerializer(AdminModelSerializer):
class Meta:
model = Address
fields = ["street", "city", "zip"]
class OrderSerializer(AdminModelSerializer):
shipping_address = AddressSerializer()
class Meta:
model = Order
fields = ["id", "number", "shipping_address"]
See also
- SchemaObjectArrayField — the same idea for an array of objects
- SchemaObjectInput — the form counterpart
- Box types — the containers that do the actual layout