# Stock Ledger block

> Full-Page SKU Inventory Ledger with Stock Health Metrics

Stock ledger with KPI and health bar, filterable SKU grid (search, category, supplier, location, status), row actions, bulk operations, and detail sheet. ReUI DataGrid, Frame, Badge; shadcn Button, Select. Inventory management and warehouse tracking.

- Type: Pro block
- Category: [Inventory](https://web.dev.reui.io/blocks/solutions/inventory.md)
- Page: https://web.dev.reui.io/blocks/solutions/inventory/solution-inventory-2
- MCP: `get_block("solution-inventory-2")`
- Built with: Avatar, Badge, Button, Data Grid, Dropdown Menu, Frame, Input Group, Scroll Area, Select, Separator, Sheet, Timeline, Tooltip
- Installs with a ReUI Pro or Ultimate license; setup: https://web.dev.reui.io/docs/license-setup

## Best for

One row per SKU and location with bin, on hand, allocated and available units, 4 filter selects and bulk Adjust or Transfer

## Agent notes

- `STOCK_ROWS` is the sample ledger and `STOCK_DETAIL` the sample sheet record; replace both with your stock and movement data
- `StockDetailSheet` always renders `STOCK_DETAIL` and `handleView` opens it only for SKU-00482; other rows get a toast
- `runBulkAction` and the row menu items Adjust, Transfer and Create PO only fire toasts; the bulk path also clears the selection

## When not to use

- A plain stock list with badges and an actions menu, with no filters or selection: use [Table](https://web.dev.reui.io/components/table.md) (`get_component("table")`)
- A product grid with stock flow tooltips and supplier logos but no bins or bulk bar: use [Stock Health](https://web.dev.reui.io/blocks/solutions/inventory/solution-inventory-6.md) (`get_block("solution-inventory-6")`)

## 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/solution-inventory-2
```

## About Inventory blocks

### When to use

- Stock overview and ledger pages: KPI tiles, a stock health bar and a filterable SKU table
- A low stock reorder queue, or a purchase order received line by line from its supplier
- Product and order overlays: stock rules, variants and photos, order review, tracking or a shipping label

### When not to use

- A team overview of KPI tiles and charts where nothing tracks stock or SKUs: use the [Dashboard blocks](https://web.dev.reui.io/blocks/application/dashboard.md)
- A side panel for a record other than a product, order or shipment: use the [Sheet blocks](https://web.dev.reui.io/blocks/application/sheet.md)
- An activity or event history on its own, with no stock or shipment around it: use the [Timeline blocks](https://web.dev.reui.io/blocks/application/timeline.md)

### Agent notes

- Every block sets a `min-h-svh` wrapper with its own padding in page.tsx or its root component; drop it when the block mounts inside your app layout
- No block fetches or saves anything: actions set local state, fire a sonner `toast`, link to a page anchor or have no handler, so wire each to your API

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.
