Group List

A Group List is a list of groups. Instead of returning a single object as its values, it returns an array of objects.

Group List Field
{
  component: 'group-list',
  name: 'grouplistName',
  label: 'Group List Field',
  description: 'A group list field',
  fields: [
    {
      component: 'text',
      name: 'textName',
      label: 'Text Field',
    },
    {
      component: 'textarea',
      name: 'textareaName',
      label: 'Text Area Field',
    },
    {
      component: 'number',
      name: 'numberName',
      label: 'Number Field',
    },
  ], 
  validate: {
    maxItems: 4,
    required: false
  }
}

Key

Type

Required

Description

component

string

yes

The name of the field component. (group-list)

name

string

yes

The name of the field that will be accessible by the cms prop of the component.

label

string

no

A human-readable label for the field.

decsription

string

no

A short description of the setting scope.

fields

Array<Field>

yes

List of fields you want in the group. All fields are supported.

validate

{ maxItems?: number; required?: boolean; }

no

An optional object that lets you add a max number of allowed items on the list or make the field required.

Last updated