Examples

Inventory editor

Built with the mantine-data-grid skill

300 of 300 products

0 products with unsaved changes

Double-click a stock, reorder, price or warehouse cell to edit. Enter or click away applies it; Escape cancels.

SKU
Category
Warehouse
Reorder at
Last counted
INV-1001

Canvas storage bin 1

Low stock
StorageNorth hub012$6.502026-10-01
INV-1002

Steel shelf bracket 1

Low stock
HardwareWest depot1720$7.872026-10-08
INV-1003

Padded mailer 1

PackagingEast depot3428$9.242026-10-15
INV-1004

Packing tape 1

SuppliesSouth hub5136$10.612026-10-22
INV-1005

Label roll 1

StorageNorth hub6812$11.982026-10-01
INV-1006

Utility knife 1

HardwareWest depot8520$13.352026-10-08
INV-1007

Safety gloves 1

Counting

Low stock
PackagingEast depot728$14.722026-10-15
INV-1008

Cable tie kit 1

Low stock
SuppliesSouth hub2436$16.092026-10-22
INV-1009

Foldable crate 1

StorageNorth hub4112$17.462026-10-01
INV-1010

Shipping sleeve 1

HardwareWest depot5820$18.832026-10-08
INV-1011

Foam wrap 1

PackagingEast depot7528$20.202026-10-15
INV-1012

Pallet strap 1

SuppliesSouth hub9236$21.572026-10-22
INV-1013

Canvas storage bin 2

StorageNorth hub1412$22.942026-10-01
INV-1014

Steel shelf bracket 2

HardwareWest depot3120$24.312026-10-08
INV-1015

Padded mailer 2

PackagingEast depot4828$25.682026-10-15
INV-1016

Packing tape 2

SuppliesSouth hub6536$27.052026-10-22
INV-1017

Label roll 2

StorageNorth hub8212$28.422026-10-01
INV-1018

Utility knife 2

Counting

Low stock
HardwareWest depot420$29.792026-10-08
INV-1019

Safety gloves 2

Low stock
PackagingEast depot2128$31.162026-10-15
INV-1020

Cable tie kit 2

SuppliesSouth hub3836$32.532026-10-22

Build the inventory editor of a warehouse app: staff correct stock, prices and warehouse assignments directly in the table, then save all changes at once.

Data:

  • about 300 generated products: SKU, name, category, warehouse (one of 4), stock, reorder level, unit price, last counted date
  • a mock save function that waits 600 ms and rejects the save when a SKU it receives is locked (2 generated products are locked for an ongoing count)

Table:

  • SKU and name stay visible on the left while the other columns scroll horizontally; columns can be resized
  • stock, reorder level and unit price are edited in place with number fields, warehouse with a select; SKU, name and last counted date are read only
  • stock and reorder level are whole numbers of 0 or more; unit price is above 0 with 2 decimals; an invalid value shows its error at the cell and is not accepted
  • Enter or leaving the cell commits the edit, Escape cancels it
  • changed cells are marked until they are saved or discarded; a counter shows how many products have unsaved changes
  • products whose stock is at or below the reorder level are marked as low stock; the mark must stay readable on selected and edited rows
  • a filter shows only low stock products, and a search finds products by SKU or name
  • sortable by name, stock and unit price; numbers are right-aligned

Saving:

  • "Save changes" sends only the changed products and shows a notification with the number saved; "Discard changes" restores the original values after a confirmation
  • when the save is rejected, nothing is saved, the locked products are pointed out in the table and the other changes stay pending
  • leaving the page with unsaved changes is not prevented, but a warning is shown next to the save button

The component is shown on a demo page that already has a title: do not add a page title or intro text.

Write tests for the component.