Skip to content

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

Land Parcels Map Block for React

Twelve parcels in one square mile of Iowa farmland on a live map: tick them to outline a site and read its acres, zone mix and whether it holds together.

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

Assemble a development site parcel by parcel with this land parcels map for React with Base UI. Platline, a land survey office, splits one square mile of Story County farmland northeast of Ames, Iowa, between the real section roads, into twelve parcels on a live Map that follows your theme, light or dark. Each parcel carries a zoning letter (A agricultural, R residential, C commercial, I light industrial), its net area in acres, worked out from its corners, and whether it's for sale. Tick parcels in the list with a Checkbox, or press them on the map: the chosen ones fill, a heavy line runs round the edge of the whole site, and four cells under the map give the parcel count, the total acres, the mix of zones and whether the site is contiguous, or how many pieces it falls into. A Switch clears the parcels that aren't for sale and dashes their labels, and Clear site starts again. Built from Map, Checkbox, Switch, Button and Guides. For land agents, developers, planners and survey offices.

FAQ

How is the outline round the site drawn?

Each parcel covers cells of a four by four lattice. edgesOf keeps the cell edges that no other chosen cell shares, as directed edges, and walkRing follows them corner to corner until each closes into a ring; a second GeoJSON layer draws those rings as the heavy line. Two separate pieces give two rings, and a site with a hole in it gives an inner ring too.

When is a site contiguous?

When its parcels make one piece. piecesOf grows each piece from one parcel by adding every chosen parcel that shares an edge with it, and counts the pieces; two parcels that only meet at a corner don't join. The cell reads "Yes, one piece" or, say, "No, 2 pieces".

Where do the acres come from?

From the corners. The section's edges sit just inside the real roads, the lattice lines fall at the fractions in ACROSS and DOWN, and cellAcres turns each cell's width and height in degrees into square meters at the section's latitude, then into acres. The parcel areas, the zones and the for-sale flags are invented; only the roads and the place are real.

Does anything leave the page?

No. The parcels, their zoning and the for-sale flags are typed in the block, ticking changes local state only, and nothing is filed, bought or sent. Only the map tiles come over the network, from CARTO's basemaps over OpenStreetMap data, with their credit kept in the corner. In your app feed LINES from your parcel records and draw your own boundaries.

Can I use it without a mouse?

Yes. Every parcel is a checkbox in the list, named by its number and zone, and does what pressing it on the map does; the switch, Clear site and the zoom buttons work from the keyboard, and the map itself takes the arrow keys and plus and minus once focused. A polite message gives the site's parcels, acres, zones and contiguity once the ticking settles.

How does it look on a phone?

The switch and Clear site sit above the map, the labels on the map shrink to the zone letter, the four cells go two by two and the list stacks in one column. Ticking never changes the block's height, so nothing jumps while you build a site.