ReferenceManyCount
Displays how many related records point back at the current record.
Installation
pnpm dlx shadcn@latest add @chelone/reference-many-countDisplays how many related records point back at the current record.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| className | string | — | A class name applied to the count's `<span>`. |
| error | ReactNode | — | Rendered when the lookup rejects. Nothing by default. |
| filter | FilterPayload | — | Permanent filter merged into the lookup, so only matching rows are counted. |
| loading | ReactNode | — | Rendered while the count is loading. Nothing by default. |
| 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"`). |
| source | string | — | The field on the current record the `target` matches. Default `"id"`. |
| target | string | — | The FK field on the reference pointing back at this record (e.g. `"author_id"`). |