Component docs
Loading
"use client";
import { FieldArray } from "@pixxl-tools/components";| Prop | Type | Default | Description |
|---|---|---|---|
items (required) | readonly FieldArrayItem[] | — | Items to render. |
addLabel | ReactNode | — | — |
onAdd | () => void | — | — |
onRemove | (id: string) => void | — | — |
removeLabel | (item: FieldArrayItem) => string | — | — |
renderItem | (item: FieldArrayItem) => ReactNode | — | — |
itemsrequiredreadonly FieldArrayItem[]
Items to render.
addLabelReactNode
onAdd() => void
onRemove(id: string) => void
removeLabel(item: FieldArrayItem) => string
renderItem(item: FieldArrayItem) => ReactNode
Other props are passed to the root element (HTMLAttributes<HTMLDivElement>), including className, style, id and aria-* attributes.
const items = [
{ id: "candraw", label: "candraw" },
{ id: "cantext", label: "cantext" },
];
<FieldArray items={items} />