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) arraysarrayItemName,arrayItemNamePluralfor friendly add/remove labelsarrayItemFieldForTitleto use a child field value as the item titlearrayNoItemsMessagefor 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
arrayNoItemsMessage: `Skip this step if there's nothing to integrate.`,
arrayItemName: 'system',
arrayItemNamePlural: 'systems',
arrayItemFieldForTitle: '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?',
arrayNoItemsMessage: `Skip this step if there's nothing to integrate.`,
arrayItemName: 'system',
arrayItemNamePlural: 'systems',
arrayItemFieldForTitle: 'systemName',
minOccurs: 0,
maxOccurs: 4,
autoAddMinOccurs: false,
fullWidth: true,
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',
},
],
},
];