Skip to content

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

Mining Operations Map Block for React

Six mines in Chile haul to one plant on real roads drawn as wide as their weekly tonnes, with a resource toggle, a mine list and four quarters of output.

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

See what is moving to the plant, with this mining operations map for React with Base UI. Seamfield, a mining company's operations view, follows six mines in Chile's Antofagasta Region to its processing plant at La Negra on a live Map that follows your theme, light or dark. Each haul road follows the real roads (Ruta 5, Ruta 25, the coast road) and is drawn as wide as the tonnes it carried a week in the last quarter, against the heaviest road the toggle keeps; each mine's marker carries its chemical symbol (Cu, Fe, Li) and its thousands of tonnes. A card floats over the map on wide screens (and docks under it on tablets and phones) with a Toggle Group that keeps the copper, iron or lithium mines, re-sizes their roads and fades the rest; the list of mines with their tonnes; and the chosen mine's four quarters as bars, with the change on the quarter before as a signed number and an arrow. Choosing a mine, by its marker, its road or its row, flies the map along its haul road and colours that road. Built from Map, Toggle Group, Button and Guides. For mining and quarrying operations, commodity dashboards and plant planners.

FAQ

How is a road's width set?

From the mine's tonnes a week in the last quarter, as a share of the heaviest road the toggle keeps: two pixels plus up to eight more. Widths are therefore relative within the chosen resource, which the caption says, and the card's header gives the real total. Roads that share a stretch are drawn heaviest first, so a lighter road stays visible inside a heavier one.

What does the change mean?

The difference between the last quarter and the one before for the chosen mine, as a percentage with one decimal, signed and with an up or down arrow. The four bars show the quarters from October 2025 to September 2026, scaled to the highest of the four, with the last one in full strength.

What does the resource toggle do?

It keeps the mines of one resource: their roads are re-sized against the heaviest of them, the other roads and markers fade, their rows turn muted and the header totals only them. If the chosen mine is not among them, the heaviest one is chosen and the map frames every road again. Choosing a faded mine, in the list or on the map, turns the toggle to its resource. All shows the six again.

Where do the roads come from, and what stays local?

Each road was asked once of the public OSRM router while the block was written, simplified to at most 80 points and typed into the file with its distance, so nothing is fetched for them. The towns and roads are real; Seamfield, its mines and every tonne in LINES are invented, and nothing is sent anywhere. In your app read tonnes per week from your production system and keep weeklyOf and changeOf as the derived figures.

Can I use it without a mouse?

Yes. The resource is a toggle group, every mine in the list is a button with a pressed state, and the zoom and show-every-road buttons work from the keyboard; the map itself takes the arrow keys and plus and minus once focused. The markers and roads are a pointer shortcut to the same choice as the list, and a polite message speaks the total and the chosen mine once the choice settles.

How does it look on a phone?

The map comes first, with each marker reduced to its symbol, and the card docks under it (as it does on a tablet) with the toggle, the list and the quarters. The list always holds all six rows, faded or not, so the page never jumps when the toggle changes.