ArrayInput
Binds an array field and renders its rows through the child iterator you supply; it has no row UI of its own.
Installation
pnpm dlx shadcn@latest add @chelone/array-inputBinds an array field and renders its rows through the child iterator you supply; it has no row UI of its own.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| addLabel | ReactNode | — | Label for the add-row button; a string is translated. |
| children | ReactNode | — | The iterator that renders the rows: map `useArrayInputResult().rows` to `<ArrayInputRow>`s. |
| className | string | — | Extra classes on the field wrapper. |
| defaultValue | readonly unknown[] | — | The array's default value (seeds an untouched hole). |
| helperText | ReactNode | — | Helper text rendered below the iterator; a string is translated. |
| itemDefaults | Record<string, unknown> | — | Object-row defaults merged into a new row (object mode). |
| label | ReactNode | — | The input label. A string is translated; a ReactNode renders as-is; `false` renders no label. |
| resource | string | — | Override the ambient resource (label-key resolution). |
| scalar | boolean | — | Force scalar-row mode (a `string[]`/`number[]`); DETECTED when omitted. |
| source | string | — | The array field path RELATIVE to the ambient source scope. |
| validate | Validator | readonly Validator[] | — | Array-level validators (e.g. `minLength`) — composed, first error wins. |