Componentpickers1.08 KB gzipZero dependencies
Field Array
Dynamic form rows: add, remove, move up/down.
Preview
Live Preview
Installation
Tokens guide →Add to your project via CLI (zero dependencies, code you own):
npx bigbullui add field-arrayOr install the full npm package:
npm install bigbulluiUsage
tsx3 lines
import { FieldArray } from "@/components/ui/field-array"; <FieldArray />Source code
field-array.tsx + 1 helperZero third-party dependencies (2 local files shown in tabs below).
tsxfield-array.tsx66 lines
"use client"; import * as React from "react";import { cn } from "./lib/utils"; export interface FieldArrayRow { id: string; value: string;} export interface FieldArrayProps extends React.HTMLAttributes<HTMLDivElement> { label?: string; rows: FieldArrayRow[]; onRowsChange?: (rows: FieldArrayRow[]) => void; placeholder?: string; maxRows?: number;} Props
Interactive Prop Playground
Tweak parsed AST props below to generate ready-to-paste JSX.
tsx3 lines
import { FieldArray } from "@/components/ui/field-array"; <FieldArray />| Prop | Type | Description |
|---|---|---|
| label | string | Accessible label text rendered or attached to the control. (Default: "Fields") |
| rows | FieldArrayRow[] | Configures rows. (Default: []) |
| onRowsChange | (rows: FieldArrayRow[]) => void | Callback invoked on rows change. |
| placeholder | string | Placeholder text shown when empty. (Default: "Value…") |
| maxRows | number | Configures max rows. (Default: 10) |