Skip to content

shadcn.io is an independent project built on shadcn/ui

Warehouse Network Map Block for React

Five hubs in England on a live map, each a ring that fills to its use; preview a move along a real motorway lane and apply it only when no hub overflows.

On this page5 sections

Preview

Preview width

Installation

Part of Pro
Pro unlocks the code and one-line install of every Pro button and text effect, plus the MCP for your AI editor.
Have Pro already? Sign in to open it.Opens here as soon as you're Pro.

Overview

Move stock where there is room before a hub overflows, with this warehouse network map for React with Base UI. Palletbrook, a logistics planner, is drawn as an app screen: a top bar with the product and its two actions, a pane with the move, and a live Map that follows your theme. Five hubs sit at their real towns in England's logistics belt (Daventry, Milton Keynes, Doncaster, Warrington and Avonmouth), each marker a ring that fills to the hub's use, and seven lanes join them along the real motorways, each as wide as the pallets it already carries a week. Two Native Selects (the second lists only the hubs on a lane from the first) and a Number Input preview a move: both rings and both rows update at once, the lane is drawn boldest in the foreground colour and carries the number, and a hub pushed past its capacity says "Over capacity by 200 pallets" in words, gets a dashed outer ring and dashes the lane. The Shine Button in the top bar applies a move that fits, and the preview carries on from the new stock; the reset button puts the start back. Clicking a hub on the map makes it the source. Built from Map, Native Select, Number Input, Shine Button, Button and Guides. For warehouse, logistics and retail operations.

FAQ

When is a move refused?

When the number is not a whole number above zero, when the source holds fewer pallets than asked, or when the destination would end up over its capacity. The line under the fields says which, the Apply button keeps its place but only answers with the reason, and nothing changes until the move fits.

What do the lanes show?

The pallets each lane already carries a week, in four widths from thin to thick, along the motorways a lorry would take. They were asked once of the public OSRM router while the block was written and typed into the file, simplified to at most 60 points each, so nothing is fetched for them. The move you preview is drawn over its lane in the foreground colour with the number on it.

How do I use my own hubs, and what stays local?

Edit HUB_LINES (an id, the town, a two-letter mark, the capacity and the place), LANE_LINES (two hub ids, the pallets a week and the road) and START, the stock by id. The rings, rows, selects and lane widths are derived from them. Applying a move changes numbers in the page and orders no transfer; in your app send the move to your warehouse system from the apply handler and update the stock from its answer.

Can I use it without a mouse?

Yes. The two selects, the number field, Apply and the reset button are ordinary controls; type a number and press Tab or Enter to settle it. The rows under the fields repeat every figure the rings show, the map's zoom buttons work from the keyboard, and a polite message speaks the preview once you stop typing.

How do I read a ring?

The dark arc is the hub's stock after the previewed move as a share of its capacity, starting at the top and going clockwise; a full ring is 100 percent. A dashed circle round it means the move would overfill the hub. The two hubs in the move are outlined, and the row under the fields shows the stock before the move as a lighter bar behind the new one.

How does it look on a phone?

The top bar keeps the product name, the reset button and Apply. The fields come first, then the map at a fixed height without the hub names (the rows carry them), then the five hubs. The preview line keeps three lines for itself, so nothing jumps when a hub overflows.