Skip to content

Array Property

An array property stores a list of values. It requires an item spec that describes what each entry looks like. The item spec can be any other property type (text, number, select, etc.), and you can even nest objects and arrays inside.

In the editor, users can add or remove items. If you want new items to start with a default value, add a default key to your item spec.

Tags
Tag

Required Parameters

item

The item spec defines the property type for each entry in the array. Like any other property, it needs at least a label and a type. The type tells the editor which input to render for each item.

Catalog.register('Sample', {
  component: Sample,
  props: {
    tags: {
      label: 'Tags',
      type: 'array',
      item: {
        label: 'Tag',
        type: 'text',
      },
    },
  },
});