Skip to content
Make with

react-map-components-maplibre

React component framework for GIS applications

Maintained by MapComponents

react-map-components-maplibre provides a comprehensive React component framework designed specifically for building GIS applications. It offers a declarative approach to map development with extensive component library, showcased in their interactive demo catalog.

Quick start

npm install @mapcomponents/react-maplibre
import { MapComponentsProvider, MapLibreMap } from '@mapcomponents/react-maplibre';

export default function App() {
  return (
    <MapComponentsProvider>
      <MapLibreMap
        options={{
          style: 'https://tiles.openfreemap.org/styles/liberty',
          center: [0, 20],
          zoom: 2,
        }}
        style={{ position: 'absolute', top: 0, bottom: 0, left: 0, right: 0 }}
      />
    </MapComponentsProvider>
  );
}
Runs this code in your browser, in a new tab.
›Setup noteschecked with v1.8.20

The package brings MapLibre GL JS v5 as its own dependency and imports maplibre-gl.css itself, so there is nothing else to install. Every map component must sit inside MapComponentsProvider; the official template puts the provider in main.tsx. React 19 is a peer dependency. To start from a template instead, run npm create mapcomponents-app@latest.

Other platforms are on SDKs.