React component suite wrapping Mapbox GL JS or MapLibre GL JS as controlled, reactive map views with hooks and context for extensions.
Overview
react-map-gl exposes Mapbox GL JS and MapLibre GL JS inside React applications. Maps behave as fully controlled components that integrate with React state and lifecycle instead of imperative-only map instances.
The library adds React-oriented interfaces such as context and hooks so teams can build custom layers, controls, and overlays. It is part of the vis.gl suite and is commonly combined with deck.gl for WebGL visualizations on top of the same map basemap.
Installation requires React 16.3 or newer alongside either mapbox-gl or maplibre-gl as a peer dependency. Documentation covers getting started, design philosophy, and examples. The project is maintained under the OpenJS Foundation vis.gl umbrella.
Developers import components into web front ends; there is no standalone map server in this package. Attribution and licensing follow the underlying map engine and data providers configured by the application.
Key features
- React API for Mapbox or MapLibre
- Controlled map state
- Context and hooks for custom UI
- Works with deck.gl stack
- MapLibre GL JS support
- Mapbox GL JS support
- Documented examples and guides
- Extensible component model
Use cases
- Interactive maps in React SPAs
- Data visualization with deck.gl
- MapLibre-based web dashboards
- Custom map controls and overlays
- Geospatial React design systems