Group-List Field

This is an advanced-use feature, and likely not something you'll need to configure. What you probably want is the content types reference!

The Group List field represents a list of group fields. This field exports an array of objects.

Use this field when you want to support multiple entities that all have the same shape. Each entity will appear in a list where you can add and delete them. You can then click into an entity to edit its individual fields according to the Group List's field definition.

Options

REQUIRED
component
'group-list'

The name of the plugin component. Always 'group-list'.


REQUIRED
name
string

The path to some value in the data being edited.


REQUIRED
fields
Field[]

An array of fields that will render as a sub-menu for each group item. The fields should map to editable content.


label
string

A human readable label for the field. Defaults to the name.


description
string

Description that expands on the purpose of the field or prompts a specific action.


default​Item
object | (() => object)

A function to provide the group-list item with default data upon being created.


item​Props
(item: object) => { key?: string; label?: string }

A function that generates props for each group item. It takes the item as an argument. It returns an object containing, key: This property is used to optimize the rendering of lists. If rendering is causing problems, use defaultItem to generate a new key, as is seen in this example. Feel free to reference the React documentation for more on keys and lists. label: A readable label for the new group-list item.

All properties marked as REQUIRED must be specified for the field to work properly.

This interfaces only shows the keys unique to the group-list field. Visit the Field Config docs for a complete list of options.

Definition

Below is an example of how a group-list field could be defined in a JSON form.

For example, if we had a list of authors in a JSON file:

Our group-list field config would look like this: