PivotGrid

The records of the ambient <List> as a table of rows by columns, with row, column and grand totals. The grid fetches nothing, so give the list a perPage that covers every record to pivot. count, the default, counts records; sum, avg, min and max read valueSource and skip values that are not numbers. A total aggregates the raw values, not the cells. A record with no row or column value lands in a (none) row or column.

Installation

pnpm dlx shadcn@latest add @chelone/pivot-grid
Loading preview…

The records of the ambient <List> as a table of rows by columns, with row, column and grand totals. The grid fetches nothing, so give the list a perPage that covers every record to pivot. count, the default, counts records; sum, avg, min and max read valueSource and skip values that are not numbers. A total aggregates the raw values, not the cells. A record with no row or column value lands in a (none) row or column.

Props

PropTypeDefaultDescription
aggregatorPivotAggregator—Default `count`.
classNamestring—
columnSourceSourceProp<TRecord>—The field whose values become the columns.
emptyReactNode—Rendered with no records, in place of `ListNoResults`.
format(value: number) => ReactNode—Prints a number in place of the locale's default text.
loadingReactNode—Rendered while the list is pending, in place of `SimpleListLoading`.
rowSourceSourceProp<TRecord>—The field whose values become the rows; a dotted path reads a nested value.
valueSourceSourceProp<TRecord>—The field the aggregator reads. Unused by `count`.