Count
How many records of a resource match a filter, optionally linked to the filtered list. It needs a resource, from its resource prop or the context.
Installation
pnpm dlx shadcn@latest add @chelone/countHow many records of a resource match a filter, optionally linked to the filtered list. It needs a resource, from its resource prop or the context.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| className | string | — | |
| filter | FilterPayload | — | |
| link | boolean | — | Link the count to the resource's list, filtered by `filter`. |
| resource | string | — | The resource to count. Defaults to the ambient resource. |
| sort | SortPayload | — | |
| timeout | number | — | Milliseconds a pending count waits before showing a spinner. Default 1000. |