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.

customAttributesobject

Custom attributes for the component.

customClassesstring | Array | object

Custom classes for the component.

depthnumber

The current depth of the repeater.

i18nobject

The i18n object for speak functions and a11y.

Properties
NameTypeDescription
beginDragobject

The message to speak when beginning a drag event (used for a11y).

deleteLabelobject

The label for the delete button (used for a11y).

dragLabelobject

The label for the drag button (used for a11y).

endDragobject

The message to speak when ending a drag event (used for a11y).

endDropobject

The message to speak when an item is dropped (used for a11y).

moveItemobject

The message to speak when moving an item (used for a11y).

idstring

The ID of the repeater.

isDraggableboolean

Whether the items in this list are draggable.

isSortableboolean

Whether the items in this list are sortable.

itemsArray

The items for the repeater.

maxItemsnumber

The max number of items to allow.

maxNestingnumber

The max number of levels of nesting to allow.

minItemsnumber

The min number of items to allow.

newItemPropsobject

The props to use for new items.

NewItemTemplatestring | function | element

The template to use for new items.

screenReaderTextAttributesobject

Custom attributes for the screen reader.

screenReaderClassesstring | Array | object

Custom classes for the screen reader.

showAddboolean

Whether to show the add button.

showArrowsboolean

Whether to show the navigation arrows.

showDragHandleboolean

Whether to show the drag handle.

showDropZoneboolean

Whether to show the drop zone.

spacingstring | number | Array | object

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

refstring

The ref to the component.

Since
  • 4.7.0
Returns:

The Repeater component.

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

return (
     <Repeater
         items={ [] }
         spacing={ { '': 6, md: 8 } }
     />
);