Componentpickers1.08 KB gzipZero dependencies

Field Array

Dynamic form rows: add, remove, move up/down.

Preview

Live Preview
Open ↗

Installation

Tokens guide →

Add to your project via CLI (zero dependencies, code you own):

npx bigbullui add field-array

Or install the full npm package:

npm install bigbullui

Usage

tsx3 lines
import { FieldArray } from "@/components/ui/field-array"; <FieldArray />

Source code

field-array.tsx + 1 helper

Zero 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 />
PropTypeDescription
labelstringAccessible label text rendered or attached to the control. (Default: "Fields")
rowsFieldArrayRow[]Configures rows. (Default: [])
onRowsChange(rows: FieldArrayRow[]) => voidCallback invoked on rows change.
placeholderstringPlaceholder text shown when empty. (Default: "Value…")
maxRowsnumberConfigures max rows. (Default: 10)