Arrays & Groups
Repeatable sections controlled by minOccurs / maxOccurs, with per-item titling and an empty-state message.
What It Demonstrates
minOccurs/maxOccursto control how many times a section can repeatautoAddMinOccurs: falsefor opt-in (empty by default) arraysarray.itemName,array.itemNamePluralfor friendly add/remove labelsarray.itemFieldForTitleto use a child field value as the item titlearray.noItemsMessagefor an empty-state prompt
Example
IsDirty: false
Touched: false
Valid: true
// form values:
{}
Array Field Options
The array behaviour is configured directly on the heading field:
ts
array: {
noItemsMessage: `Skip this step if there's nothing to integrate.`,
itemName: 'system',
itemNamePlural: 'systems',
itemFieldForTitle: 'systemName',
},
minOccurs: 0,
maxOccurs: 4,
autoAddMinOccurs: false,Full Metadata
ts
const metadata: Metadata[] = [
{
name: 'systems',
type: 'heading',
fieldOptions: { label: 'Systems to connect' },
description: `Any external tools we'll integrate with during onboarding.`,
helpText: 'What needs to connect?',
array: {
noItemsMessage: `Skip this step if there's nothing to integrate.`,
itemName: 'system',
itemNamePlural: 'systems',
itemFieldForTitle: 'systemName',
},
minOccurs: 0,
maxOccurs: 4,
autoAddMinOccurs: false,
colSpan: 'full',
children: [
{
name: 'systemName',
fieldOptions: { label: 'System name' },
placeholder: 'e.g. Salesforce, HubSpot',
},
{
name: 'purpose',
fieldOptions: { label: 'Purpose in the rollout' },
placeholder: 'e.g. source of CRM records',
},
],
},
];