# Pricing Plan Editor block

> Pricing Plan Editor With Per-Row Edit Mode and Inline Validation

Per-row edit-mode data grid for pricing plans: the table is read-only until one row is checked out with Edit, its fields turn into inline inputs and selects bound to a single draft, and Save or Cancel commits or reverts that one row on its own with no global save bar and no bulk actions

- Type: Pro block
- Category: [Editing](https://web.dev.reui.io/blocks/data-grid/editing.md)
- Page: https://web.dev.reui.io/blocks/data-grid/editing/data-grid-editing-4
- Docs (Base UI): https://web.dev.reui.io/docs/components/base/data-grid.md
- Docs (Radix UI): https://web.dev.reui.io/docs/components/radix/data-grid.md
- MCP: `get_block("data-grid-editing-4")`
- Built with: Alert Dialog, Badge, Button, Data Grid, Dropdown Menu, Frame, Input, Select, Switch, Tooltip
- Installs with a ReUI Pro or Ultimate license; setup: https://web.dev.reui.io/docs/license-setup

## Best for

Plan rows that stay read only until Edit checks one out, locking every other row until it saves or cancels on its own

## Agent notes

- `PLANS` seeds `rows` in `PlanEditingDataGridView`; load your own `PricingPlan` records there
- `saveEdit` writes one draft row into `rows` and shows a toast saying to connect your billing API; call it there
- `handleAddPlan` and `duplicateRow` create unsaved rows that `cancelEdit` drops, so persist only inside `saveEdit`

## When not to use

- Many cells edited together and saved with one Save changes bar: use [Product Inventory](https://web.dev.reui.io/blocks/data-grid/editing/data-grid-editing-2.md) (`get_block("data-grid-editing-2")`)
- Long lists of rows that load in batches while scrolling: use [Card Payments Ledger](https://web.dev.reui.io/blocks/data-grid/virtualization/data-grid-virtualization-1.md) (`get_block("data-grid-virtualization-1")`)

## 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-editing-4
```

## About Editing blocks

### When to use

- Admin tables whose values are typed into cells or rows, validated, then saved or discarded
- Spreadsheet work over long lists: cell ranges, paste, drag to fill and undo
- Small catalogs such as labels or pricing plans, where one record is edited and saved at a time

### When not to use

- Cell editing added to a table you already build from parts in your own layout: use [Data Grid](https://web.dev.reui.io/components/data-grid.md) (`get_component("data-grid")`)
- Rows that are only browsed, filtered and paged, with no values changed in the cells: use the [Base blocks](https://web.dev.reui.io/blocks/data-grid/base.md)
- A plain list reordered by drag, with no form to add or rename its items: use [Sortable](https://web.dev.reui.io/components/sortable.md) (`get_component("sortable")`)

### Agent notes

- Every page.tsx renders an sr-only `h1` inside a centered `min-h-svh` main; remove that wrapper when the view sits in your own page
- Rows start from a data file constant held in `useState` or `useReducer`, and nothing reaches a server; call your API where each edit or save commits

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