Can I add multiple default values for list items?

I have a custom component with a field of type ‘list’.
By default, I want to have certain entries already for the list which the user can edit.
e.g. Field name is ‘MenuItems’
It has subfield ‘MenuItemName’.

By default, I want to have a list of data already created as follows:

  • MenuItemName 1
  • MenuItemName 2
  • MenuItemName 3

User should be able to treat it like normal field entry which they can edit or delete.

Please let me know how I can achieve this?

Hi @olivela

You can apply a default value to your list field:

{
      name: 'menuItems',
      type: 'list',
      defaultValue: [ 
            { menuItem: 'Salmon and Rice' },
            { menuItem: 'Chicken and Squash' },
            { menuItem: 'Beans and Eggs' }
      ],
      subFields: [
	     {
          name: 'menuItem',
          type: 'string',
          defaultValue: '"Dish Name"',
         }
      ]
    }

Thanks!
~ Logan from Builder.io