FormGetting StartedField Array

Field Array

Utility component for handling dynamic field arrays in shaddy form.

FieldArray is a utility component that uses the function-as-children pattern to make working with react-hook-form field arrays simple and ergonomic inside a shaddy form.
It provides a convenient way to render, append, and remove groups of fields dynamically, without having to manage the array logic yourself.

Installation

pnpm dlx shadcn@latest add https://shaddy-docs.vercel.app/r/field-array

Usage

<FieldArray name="items">
  {({ fields }) =>
    fields.map((field, index) => (
      <TextField key={field.id} name={`items.${index}.name`} />
    ))
  }
</FieldArray>