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-input

Binds an array field and renders its rows through the child iterator you supply; it has no row UI of its own.

Props

PropTypeDefaultDescription
addLabelReactNode—Label for the add-row button; a string is translated.
childrenReactNode—The iterator that renders the rows: map `useArrayInputResult().rows` to `<ArrayInputRow>`s.
classNamestring—Extra classes on the field wrapper.
defaultValuereadonly unknown[]—The array's default value (seeds an untouched hole).
helperTextReactNode—Helper text rendered below the iterator; a string is translated.
itemDefaultsRecord<string, unknown>—Object-row defaults merged into a new row (object mode).
labelReactNode—The input label. A string is translated; a ReactNode renders as-is; `false` renders no label.
resourcestring—Override the ambient resource (label-key resolution).
scalarboolean—Force scalar-row mode (a `string[]`/`number[]`); DETECTED when omitted.
sourcestring—The array field path RELATIVE to the ambient source scope.
validateValidator | readonly Validator[]—Array-level validators (e.g. `minLength`) — composed, first error wins.