ArrayInputcomponent
ArrayInput(props: ArrayInputProps<T>): ReactElement
| Param | Type | |
|---|---|---|
props | ArrayInputProps<T> | Props for ArrayInput, a repeating input that edits an array of schema-validated items. required |
.one | string | |
.many | string | |
.min | number | |
.max | number | |
.items | Schema<T> | Schema for the items in the repeater. required |
| Return | |
|---|---|
ReactElement | Element rendering one input row per array item plus add/clear controls. |
Repeating input that edits an array of items, adding a SchemaInput row per item.
- Each item is validated and rendered using the supplied
itemsschema. - Enforces
min/maxlength and offers add, remove, and clear controls.
Examples
<ArrayInput name="tags" items={STRING} value={tags} onValue={setTags} />