ProGridSign in

Get started

Data, state, and extension points

The component owns sensible interaction state by default, while every important slice can be initialized, observed, or controlled by the host application.

Data and columns

Rows are plain objects. Columns describe access, presentation, and opt-in capabilities such as filtering, grouping, aggregation, and chart semantics. Keep both references stable when possible.

Custom cell rendering

cell is a standard TanStack Table column function, not a ProGrid-specific prop — return any ReactNode from it to replace a column’s default rendering, such as a status badge instead of raw text.

{
  accessorKey: "status",
  header: "Status",
  cell: ({ getValue }) => {
    const status = String(getValue())
    return (
      <span className={`order-status order-status--${status.toLowerCase()}`}>
        {status}
      </span>
    )
  },
  meta: { filterVariant: "set", filterOptions: ["New", "Processing", "Complete"] },
}

Custom header rendering

header is the same TanStack column field family as cell — a string, or a function returning a ReactNode, called with the header context (column, table). ProGrid adds one shortcut on top: meta.headerIcon for an icon-only header that still keeps the sort/pin/resize/filter chrome around it.

{
  accessorKey: "revenue",
  header: () => (
    <span className="flex items-center gap-1">
      <DollarSign className="size-3.5" />
      Revenue
    </span>
  ),
  meta: { label: "Revenue", align: "right" },
}

Controlled state

Pass only the slices your application needs to own. Everything omitted from state remains internally managed, and onStateChange reports the complete next state.

const [columnFilters, setColumnFilters] = useState<ColumnFilter[]>([])

<ProGrid
  columns={columns}
  data={orders}
  state={{ columnFilters }}
  onStateChange={(next) => setColumnFilters(next.columnFilters)}
/>

Client and server modes

Client mode processes the supplied data in memory. Server mode emits the same normalized query for paging, sorting, filters, search, and grouping, so moving a screen to an API does not change its interaction model.