ReferenceManyField

Fetches related records with getManyReference, paging, sorting and filtering on the server.

Installation

pnpm dlx shadcn@latest add @chelone/reference-many-field

Fetches related records with getManyReference, paging, sorting and filtering on the server.

Props

PropTypeDefaultDescription
childrenReactNode—The list-rendering children (a `DataTable`, etc.).
debouncenumber—Debounce delay in ms for debounced `setFilters` calls. Default 500.
filterFilterPayload—Permanent filter merged into the reference lookup.
perPagenumber—Page size for the related list. Default 25.
recordRecordType—The record whose id is matched. Defaults to the ambient record.
referencestring—The referenced resource holding the reverse FK (e.g. `"books"`).
sortSortPayload—Initial sort of the related list. Default id ascending.
sourcestring—The field on the current record the `target` matches. Default `"id"`.
storeKeystring | false—KV namespace for the list params and selection. Default `${reference}.${target}.${id}`; `false` keeps them in memory.
targetstring—The FK field on the reference pointing back at this record (e.g. `"author_id"`).