
Mapbox Web Integration Patterns
mapbox/mapbox-agent-skillsOfficial
Integration patterns for Mapbox GL JS across React, Vue, Svelte, and Angular, with lifecycle and cleanup guidance.
- skills.sh installs
- 2.7K
- GitHub stars
- 87
- last updated
- Aug 21, 2026
What it does
- Covers setup, token handling, Search JS integration, and version requirements for GL JS v3.x and framework versions
- Includes React patterns using
useRefanduseEffect, with Search JSSearchBoxwiring and a Vite-based token example - Enforces calling
map.remove()on cleanup and initializing maps outside render to avoid leaks and infinite loops - Designed for developers integrating Mapbox GL JS into React, Vue, Svelte, Angular, or Next.js apps
Install
$ npx -y skills add mapbox/mapbox-agent-skills --skill mapbox-web-integration-patterns -yInstalls into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.
Files
Mapbox Integration Patterns Skill
This skill provides official patterns for integrating Mapbox GL JS into web applications using React, Vue, Svelte, Angular, and vanilla JavaScript. These patterns are based on Mapbox's create-web-app scaffolding tool and represent production-ready best practices.
Version Requirements
Mapbox GL JS
Recommended: v3.x (latest)
- Minimum: v3.0.0
- Why v3.x: Modern API, improved performance, active development
- v2.x: Legacy; no longer actively developed (see migration notes below)
Installing via npm (recommended for production):
npm install mapbox-gl@^3.0.0 # Installs latest v3.x
CDN (for prototyping only):
<!-- Replace VERSION with latest v3.x from https://docs.mapbox.com/mapbox-gl-js/ -->
<script src="https://api.mapbox.com/mapbox-gl-js/vVERSION/mapbox-gl.js"></script>
<link href="https://api.mapbox.com/mapbox-gl-js/vVERSION/mapbox-gl.css" rel="stylesheet" />
Framework Requirements
Details
- Repository
- github.com/mapbox/mapbox-agent-skills
- Category
- Frontend & UI Code
- First seen
- Apr 16, 2026
More from mapbox/mapbox-agent-skills
All 18- Mapbox Web Performance Patterns2.6K
- Mapbox Style Patterns2.5K
- Mapbox Geospatial Operations2.3K
- Mapbox Cartography2.2K
- Mapbox Data Visualization Patterns2.2K
- Mapbox Style Quality2.1K
- Mapbox Token Security2K
- Mapbox Search Integration2K
- Mapbox Search Patterns1.9K
- Mapbox Store Locator Patterns1.8K
- Mapbox Mcp Devkit Patterns1.6K
- Mapbox Ios Patterns1.5K
- Mapbox Android Patterns1.5K
- Mapbox Google Maps Migration1.5K
- Mapbox Mcp Runtime Patterns1.5K
- Mapbox Maplibre Migration1.4K
- Mapbox Location Grounding1.3K
Similar to Mapbox Web Integration Patterns
More Frontend & UI Code
mapbox-google-maps-migrationmapbox/mapbox-agent-skills1.5K installsMigration guide mapping Google Maps Platform APIs and patterns onto Mapbox GL JS equivalents.
mapbox-search-integrationmapbox/mapbox-agent-skills2K installsComplete discovery-to-production workflow for Mapbox search, defaulting to the Search Box API for interactive use.
maplibre-mapbox-migrationmaplibre/maplibre-agent-skills513 installsMigrating an existing Mapbox GL JS map to MapLibre: swap packages, drop the access token, and pick a new tile source.
syncfusion-react-mapssyncfusion/react-ui-components-skills738 installsInteractive React maps component with GeoJSON, map providers, markers, bubbles, and choropleth coloring.
apollo-clientapollographql/skills5.8K installsGuide for building React apps with Apollo Client 4.x covering queries, mutations, caching, and local state.