Free storage volume depends on consistent dimensions and units. Derive capacity and usage in the same unit before formatting a human-readable summary.
Worked example
// app/warehouse/page.tsx
export default function FreeBinVolume() {
const bins = [
{ id: "A01", sku: "pen", qty: 12, limit: 20 },
{ id: "B04", sku: "pad", qty: 3, limit: 15 },
{ id: "A09", sku: "pen", qty: 5, limit: 10 },
];
return (
<ol>
{bins.map((b) => (
<li key={b.id}>
{b.id}: {b.limit - b.qty} units free
</li>
))}
</ol>
);
}Implementation notes
A negative free-volume result signals inconsistent data or an overfilled bin. Choose whether to display an exception state instead of clipping it to zero.
Try it yourself
Test an empty bin and a bin whose recorded use exceeds its capacity.
Open the Next.js example →Editorial date November 29, 2026 · Published December 6, 2026