Leaflet
Optional Leaflet-based map fields, form inputs, drawing/editing primitives, OSM utilities, and geocoding for Shadmin.
Installation
pnpm dlx shadcn@latest add @shadmin/leaflet-adminThe leaflet-admin block provides Leaflet-based components for displaying and editing geographic data.
npx shadcn@latest add https://shadmin.turtlesocks.dev/r/leaflet-admin.jsonComponents
Lat/Lng (coordinate pair fields)
<LatLngField>— read-only map marker<LatLngInput>— draggable marker input
GeoJSON shape Fields & Inputs
<PointField>/<PointInput><MultiPointField>/<MultiPointInput><LineStringField>/<LineStringInput><MultiLineStringField>/<MultiLineStringInput><PolygonField>/<PolygonInput><MultiPolygonField>/<MultiPolygonInput><GeometryCollectionField>/<GeometryCollectionInput><BBoxField>/<BBoxInput><GeoJsonField>/<GeoJsonInput>— polymorphic<FeatureField>/<FeatureInput>—GeoJSON.Featurewith preservedproperties<FeatureCollectionField>/<FeatureCollectionInput>— multi-feature collections<SimplifyInput>— turf-driven geometry simplification with tolerance slider
Drawing & editing primitives (Geoman)
useGeomanRHF— bridges Geoman draw/edit events to a React Hook Form field. Compose with<FeatureGroup>+<GeomanControls>fromreact-leaflet-geoman-v2.