ReferenceManyCount

Displays how many related records point back at the current record.

Installation

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

Displays how many related records point back at the current record.

Props

PropTypeDefaultDescription
classNamestring—A class name applied to the count's `<span>`.
errorReactNode—Rendered when the lookup rejects. Nothing by default.
filterFilterPayload—Permanent filter merged into the lookup, so only matching rows are counted.
loadingReactNode—Rendered while the count is loading. Nothing by default.
recordRecordType—The record whose id is matched. Defaults to the ambient record.
referencestring—The referenced resource holding the reverse FK (e.g. `"books"`).
sourcestring—The field on the current record the `target` matches. Default `"id"`.
targetstring—The FK field on the reference pointing back at this record (e.g. `"author_id"`).