Skip to content

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

Agricultural Fields Map Block for React

Nine real paddocks on a live map shaded by soil moisture, with a slider that sets an irrigation line, outlines every field under it and totals the water.

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

Decide which fields to water, and how much, with this agricultural fields map for React with Base UI. Furrowmark, a farm management app, reads a soil probe in each of nine paddocks east of Coleambally, in the Riverina of New South Wales, drawn at their surveyed outlines on a live Map that follows your theme, light or dark. Each field is filled by its moisture in five steps of the theme's chart colours, with its crop code and reading in a pill. A Slider over the map sets the line from 30 to 70 percent of field capacity: every field under it gets a dashed outline and a drop, and the band beside the slider totals the fields, the hectares and the megalitres it takes to bring them back to the line. Hectares are measured from each outline and the water is the shortfall times the crop's rate. The table under the map lists every field, driest first, with its crop, area, moisture and water; choosing a field there or on the map flies the camera to it, and the outline button frames the farm again. Built from Map, Slider, Button and Guides. For farm managers, agronomists and irrigation planners.

FAQ

How is the water worked out?

For each field under the line, its hectares times the points of moisture it is short of the line times its crop's rate in megalitres a hectare for each point (CROPS). A field at or above the line needs none. The totals add every field under the line, so they always match the table's Water column.

Where do the hectares come from?

From the outlines themselves. hectaresOf measures each ring of coordinates with the shoelace formula, flattened at the farm's latitude, so the area in the table is the area drawn on the map. The outlines are real paddocks near Coleambally; the names, crops, readings and rates are invented for this demo.

Is the fill the only signal?

No. A field under the line has a dashed outline and a drop in its pill on the map, and in the table a drop, a hidden "Under the line" for screen readers and its megalitres in the Water column; fields above the line read None. The legend names each moisture step in words.

Can I use it without a mouse?

Yes. The slider takes the arrow keys and speaks its value as a percent of field capacity, every field name in the table is a button that flies the map to it, and the zoom and outline buttons work from the keyboard; the map itself takes the arrow keys and plus and minus once focused. A polite message gives the totals and the chosen field once the choice settles.

What stays local in the demo, and how do I wire it up?

All of it. The paddocks, the probe readings and the water rates are typed into the file; nothing is fetched apart from the map tiles, and no valve is opened or schedule sent. In your app load the outlines from your farm records and the moisture from your probes, and keep waterOf, the one place the water is decided.

How does it look on a phone?

The slider and the three totals sit above the map, the pills drop their crop codes, and the table keeps three columns with each field's crop and hectares under its name. Moving the slider never changes the height of the block.