A Repeater component with id wrapper.

Parameters:
NameTypeDescription
propsobject

Component props.

Properties
NameTypeDescription
addButtonAttributesobject

Custom attributes for the add button.

addButtonClassesstring | Array | object

Custom classes for the add button.

blockHeaderAttributesobject

Custom attributes for the block header (only used in block mode).

blockHeaderClassesstring | Array | object

Custom classes for the block header (only used in block mode).

collapsibleboolean

If the repeater is collapsible.

collapsibleButtonAttributesobject

Custom attributes for the collapsible button.

collapsibleButtonClassesstring | Array | object

Custom classes for the collapsible button.

customAttributesobject

Custom attributes for the component.

customClassesstring | Array | object

Custom classes for the component.

deleteButtonAttributesobject

Custom attributes for the delete button.

deleteButtonClassesstring | Array | object

Custom classes for the delete button.

downButtonAttributesobject

Custom attributes for the down button.

downButtonClassesstring | Array | object

Custom classes for the down button.

dragHandleAttributesobject

Custom attributes for the drag handle.

dragHandleClassesstring | Array | object

Custom classes for the drag handle.

fillContentboolean

If the content should fill the available space.

i18nobject

Internationalization strings.

idstring

The id for the repeater. Required.

isDraggableboolean

If the items are draggable.

isSortableboolean

If the items are sortable.

itemAttributesobject

Custom attributes for the item.

itemClassesstring | Array | object

Custom classes for the item.

itemDraggableboolean

If the items are draggable.

itemsArray

The items to display, managed by external state.

itemSpacingstring | number | Array | object

The spacing for the item, as a string, number, array, or object.

maxItemsnumber

The maximum number of items allowed.

minItemsnumber

The minimum number of items allowed.

newItemStateobject

The state for a new item.

onChangefunction

The function to call when the items change.

renderItemfunction

The function to render the item.

screenReaderAttributesobject

Custom attributes for the screen reader text.

screenReaderClassesstring | Array | object

Custom classes for the screen reader text.

showAddboolean

If the add button should be displayed.

showArrowsboolean

If the arrows should be displayed.

showDeleteboolean

If the delete button should be displayed.

showDragHandleboolean

If the drag handle should be displayed.

spacingstring | number | Array | object

The spacing for the component, as a string, number, array, or object.

typestring

The type of the repeater.

upButtonAttributesobject

Custom attributes for the up button.

upButtonClassesstring | Array | object

Custom classes for the up button.

Since
  • 4.7.0
Returns:

The Repeater component.

Type: 
JSX.Element
Example
import Repeater from '@gravityforms/components/react/admin/modules/Repeater';

return (
     <Repeater
         id="repeater-test"
         items={ [
             {
             some_key: 1,
             name: 'Item 1',
             repeater_item_collapsed: true,
             repeater_item_block_content_title: 'Block Content Title',
             repeater_item_id: 'repeater-test-1'
             },
         ] }
         spacing={ { '': 6, md: 8 } }
     />
);