ArrayField
| Generic types: | TFields |
| Extends: | |
Array field interface for creating dynamic field collections that map to array values.
Key concepts:
- The
fieldsarray defines the TEMPLATE (single field definition), not instances - Array items are created/removed dynamically at runtime via event bus
- For primitive arrays: Use a leaf field as template →
['value1', 'value2'] - For object arrays: Use a group field as template →
[{key1: val1}, {key2: val2}]
Properties
| Name | Type | Description |
|---|---|---|
| className inherited from | string | undefined | Additional CSS classes for custom styling. Space-separated string of CSS class names that will be applied to the field container for custom styling. |
Example usage | ||
| col inherited from | number | undefined | Column sizing configuration for responsive grid layout. Specifies how many columns this field should span in a 12-column grid system. Supports responsive behavior and field arrangement. |
Example usage | ||
| disabled inherited from | boolean | undefined | Whether the field is disabled and cannot be interacted with. When true, the field is rendered in a disabled state and cannot receive user input. The value can still be modified programmatically. @value false |
| fields r | TFields | Template field definition(s) that will be cloned for each array item. Typically contains a single field definition:
|
| key inherited from | string | Unique field identifier used for form binding and value tracking. This key is used to associate the field with form values and must be unique within the form. It follows object property naming conventions. |
Example usage | ||
| label r overrides | undefined | Array fields do not have a label property * |
| props inherited from | TProps | undefined | Field-specific properties and configuration options. Contains type-specific configuration that varies based on the field type. The shape is defined by the TProps generic parameter. |
Example usage | ||
| readonly inherited from | boolean | undefined | Whether the field is read-only. When true, the field displays its value but cannot be modified by user interaction. Differs from disabled in styling and accessibility. @value false |
| tabIndex inherited from | number | undefined | Tab index for keyboard navigation. Controls the order in which fields receive focus when navigating with the Tab key. Follows standard HTML tabindex behavior. |
Example usage | ||
| type overrides | "array" | Field type identifier for component selection. Determines which component will be rendered for this field. Must match a registered field type name in the field registry. |
Example usage | ||
Example usage
// Primitive array (flat values) { key: 'tags', type: 'array', fields: [{ key: 'tag', type: 'input' }] } // Creates: { tags: ['tag1', 'tag2', 'tag3'] }
// Object array (nested groups) { key: 'contacts', type: 'array', fields: [{ type: 'group', fields: [ { key: 'name', type: 'input' }, { key: 'email', type: 'input' } ] }] } // Creates: { contacts: [{name: '', email: ''}, {name: '', email: ''}] }
Nesting constraints: Arrays can contain rows, leaf fields, or groups (for object arrays), but NOT pages or other arrays. Runtime validation enforces these rules.