MapLibre GL Components

Legend, colorbar, and HTML control components for MapLibre GL JS maps

Colorbar

Continuous gradient legends with built-in matplotlib colormaps. Supports horizontal and vertical orientations.

Legend

Categorical legends with color swatches and labels. Collapsible with customizable styling.

HtmlControl

Flexible HTML content control for custom info panels, statistics, and widgets.

BasemapControl

Switch between 100+ basemaps from xyzservices. Supports dropdown and gallery modes.

MeasureControl

Measure distances and areas on the map with interactive drawing tools.

BookmarkControl

Save and restore map view locations with localStorage persistence.

PrintControl

Export the current map view as PNG or JPEG with optional title overlay.

MinimapControl

Inset overview map showing the current viewport extent with optional click-to-navigate.

React Support

First-class React components and hooks for seamless integration with React apps.

Examples

Installation

npm install maplibre-gl-components
View on GitHub →