# Customer Balances block

> Customer balances data grid with CRUD sheets, balance trends and bulk actions

Customer CRM table: search, status filter, avatar rows, balance trends with reversal tooltips, a tabbed view sheet, add and edit form sheets, delete with Undo, bulk status and CSV export. ReUI DataGrid, Frame, Badge, Cascader.

- Type: Pro block
- Category: [Base](https://reui.io/blocks/data-grid/base.md)
- Page: https://reui.io/blocks/data-grid/base/data-grid-base-1
- Docs (Base UI): https://reui.io/docs/components/base/data-grid.md
- Docs (Radix UI): https://reui.io/docs/components/radix/data-grid.md
- MCP: `get_block("data-grid-base-1")`
- Built with: Alert Dialog, Avatar, Badge, Button, Cascader, Data Grid, Dropdown Menu, Empty, Field, Frame, Input, Input Group, Kbd, Number Field, Popover, Select, Separator, Sheet, Skeleton, Switch, Tabs, Tooltip
- Installs with a ReUI Pro or Ultimate license; setup: https://reui.io/docs/license-setup

## Best for

Customer accounts with balances against the prior statement, reversal notes, a tabbed view sheet and full CRUD with Undo

## Agent notes

- Replace `CUSTOMERS` and the fixed demo clock `TODAY` and `NOW` in data.tsx; `COMPANY_LOGOS` maps a company name to its mark
- `useCustomerStore` changes only React state; send `createCustomer`, `updateCustomer`, `setStatus` and `removeCustomers` to your API and keep each `undo`
- `balanceTrend` in format.ts derives the change from `previousBalance`; `downloadCustomersCsv` in customer-export.ts builds the CSV

## When not to use

- Companies to prospect, with intent signals, owners and saved lists: use [Prospect Database](https://reui.io/blocks/data-grid/advanced/data-grid-advanced-22.md) (`get_block("data-grid-advanced-22")`)

## Third-party libraries

- TanStack Table v9: [API reference](https://tanstack.com/table/v9/docs/framework/react/reference/index), [docs](https://tanstack.com/table/v9/docs/framework/react/quick-start)
- Sonner v2: [API reference](https://sonner.emilkowal.ski/toast), [docs](https://sonner.emilkowal.ski/getting-started)

## Install

```bash
npx shadcn@latest add @reui/data-grid-base-1
```

## About Base blocks

### When to use

- A whole table section: a title, a create button, filter controls, the rows and pagination
- Customer, contact and deal tables for a sales team, with a row menu, pinned rows or a rule filter bar
- Operations tables for support tickets, weekly timesheets, team members, project modules or SKU prices

### When not to use

- A bare table for your own columns and rows, without a title bar, toolbar or demo rows: use [Data Grid](https://reui.io/components/data-grid.md) (`get_component("data-grid")`)
- Thousands of rows in one scrolling list that loads more as the reader nears the end: use the [Virtualization blocks](https://reui.io/blocks/data-grid/virtualization.md)
- A payments ledger, a renewals queue or an automation library led by a rule filter bar: use the [Filtering blocks](https://reui.io/blocks/data-grid/filtering.md)

### Agent notes

- Each page.tsx wraps the table in a centered `min-h-svh` main under an sr-only `h1`; drop that wrapper and keep a single `h1` once it sits in your page
- Each block filters and pages its data.tsx rows in the browser with `pagination` in local state; move both to your API before the row count grows large

Every ReUI item has a twin like this one; the index is https://reui.io/llms.txt. Agents with the ReUI MCP (https://reui.io/docs/mcp) get the same guidance from the getters named above.
