Skip to content

EnformaRepeatable

The schema for repeatable components is almost identical to the component's props

Props

PropTypeDescription
nameStringThe field name for the array (required)
minNumberMinimum number of items (default: 0)
maxNumberMaximum number of items (default: Infinity)
subfieldsObjectRecord of field schemas to use within each repeatable item (optional)
defaultValueAnyDefault value for new items when added
validateOnAddBooleanWhether to validate when adding a new item (default: true)
validateOnRemoveBooleanWhether to validate when removing an item (default: true)
addButtonComponentCustom add button component
removeButtonComponentCustom remove button component
moveUpButtonComponentCustom move up button component
moveDownButtonComponentCustom move down button component
allowAddBooleanWhether to allow adding new items (default: true)
allowRemoveBooleanWhether to allow removing items (default: true)
allowSortBooleanWhether to allow sorting items (default: true)

Slots

The component only exposes the #default slot which you can use to organize the layout of the component if the subfields props is not enough or you don't want to use it.

Styling

The component uses the following props from the configuration:

  • pt.repeatable.wrapper - The outer wrapper div
  • pt.repeatable.items - The container for repeatable items
  • pt.repeatable.item - Each individual repeatable item
  • pt.repeatable.actions - The container for the add button
  • pt.repeatable.itemActions - The container for item action buttons (remove, move)
  • pt.repeatable.add - The add button styling
  • pt.repeatable.remove - The remove button styling
  • pt.repeatable.moveUp - The move up button styling
  • pt.repeatable.moveDown - The move down button styling

Released under the MIT License