ReferenceManyField
Fetches related records with getManyReference, paging, sorting and filtering on the server.
Installation
pnpm dlx shadcn@latest add @chelone/reference-many-fieldFetches related records with getManyReference, paging, sorting and filtering on the server.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| children | ReactNode | — | The list-rendering children (a `DataTable`, etc.). |
| debounce | number | — | Debounce delay in ms for debounced `setFilters` calls. Default 500. |
| filter | FilterPayload | — | Permanent filter merged into the reference lookup. |
| perPage | number | — | Page size for the related list. Default 25. |
| record | RecordType | — | The record whose id is matched. Defaults to the ambient record. |
| reference | string | — | The referenced resource holding the reverse FK (e.g. `"books"`). |
| sort | SortPayload | — | Initial sort of the related list. Default id ascending. |
| source | string | — | The field on the current record the `target` matches. Default `"id"`. |
| storeKey | string | false | — | KV namespace for the list params and selection. Default `${reference}.${target}.${id}`; `false` keeps them in memory. |
| target | string | — | The FK field on the reference pointing back at this record (e.g. `"author_id"`). |