mapbox-web-integration-patterns
Skill by mapbox
Provides official Mapbox GL JS integration patterns for React, Vue, Svelte, Angular and vanilla JavaScript web apps. It is for developers adding maps and Mapbox Search to web projects.
Install mapbox-web-integration-patterns
Built from the published package, never by AI.
git clone --depth 1 https://github.com/mapbox/mapbox-agent-skills /tmp/mapbox-agent-skills && mkdir -p ~/.claude/skills && cp -r /tmp/mapbox-agent-skills/skills/mapbox-web-integration-patterns ~/.claude/skills/mapbox-web-integration-patternsRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
Step-by-step: install mapbox-web-integration-patterns in Claude Code
git clone --depth 1 https://github.com/mapbox/mapbox-agent-skills /tmp/mapbox-agent-skills && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/mapbox-agent-skills/skills/mapbox-web-integration-patterns ~/.gemini/antigravity-cli/skills/mapbox-web-integration-patternsAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Step-by-step: install mapbox-web-integration-patterns in Antigravity CLI
Skills can run scripts on your machine. Some need an API key: check the README.
About
This skill gives an AI assistant official patterns for integrating Mapbox GL JS into web applications. It covers setup, version requirements, and lifecycle management, including calling map.remove() on cleanup. It also covers token handling with environment variables and Mapbox Search JS integration with a SearchBox component.
The patterns are based on Mapbox's create-web-app scaffolding tool. The source includes React examples in detail and lists reference files for Vue, Svelte, Angular, Next.js, vanilla JavaScript and Web Components. It also lists common mistakes, such as storing the map in Vue's data() and losing layers after setStyle. Developers building or debugging Mapbox maps in these frameworks are the intended audience.
Written from the project's SKILL.md and checked against it.
What it can do
- Map setupGuides installing Mapbox GL JS v3.x through npm or the CDN.
- React map componentShows a useRef and useEffect pattern with cleanup for a Mapbox map.
- Framework patternsLists integration references for Vue, Svelte, Angular, Next.js and vanilla JavaScript.
- Token handlingDescribes using environment variables and global or per-map access tokens.
- Search integrationShows adding a Mapbox SearchBox with proximity and marker options to a map.
- Lifecycle cleanupExplains calling map.remove() on unmount to prevent memory leaks.
- Common pitfallsCovers mistakes such as map init in render, Vue data() proxies and silent style errors.
- Web ComponentsPoints to reference patterns for framework-agnostic Mapbox web components.
What you need
- Mapbox access token
- Mapbox GL JS v3.0.0 or later
- WebGL 2 support in the browser
- React 16.8 or later for the React pattern
Try asking
- Add a Mapbox GL JS map to my React component with proper cleanup
- Show me how to add Mapbox Search with a proximity bias to my app
- Why is my Vue Mapbox map blank after I store it in data()?
Good to know
- Mapbox GL JS v2.x is legacy and no longer actively developed.
- The CDN setup is described as for prototyping only.
- Framework-specific details are in reference files that are not included in this text.
- Deck.gl CDN examples in the source are noted as broken for the jsDelivr path.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: skills/mapbox-web-integration-patterns/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work
Alternatives to mapbox-web-integration-patterns
All alternatives →Runs a 7-stage workflow for auditing, cleaning up and reviewing GitHub repositories, plus competitor analysis. Written for developers who want a repo checked for secrets, junk files and documentation gaps.
Teaches an AI assistant to build, debug and explain Gradio web UIs and ML demos in Python. It covers the core API, components, event listeners, layouts and the MCP server option. Aimed at Python developers who work with Gradio.
Recommends menus, buttons, toolbars and disclosure controls for Apple platforms using Human Interface Guidelines conventions. Built for developers and designers making iOS, iPadOS, macOS or visionOS interfaces. Checks existing project design context before asking questions.
Creates production-ready FastAPI project structures with async patterns, dependency injection, and error handling. It is for developers starting new FastAPI applications or backend API projects.
Analyzes Android apps to find user workflows to expose as AppFunctions, so AI agents and system shortcuts can run them without opening the app UI. Generates Kotlin code and refines KDoc for Android developers.
Creates, edits, validates and runs Agent QA tests, suites and hooks through MCP or CLI. It keeps canonical IDs and schema contracts intact, for developers and QA teams using Agent QA.
Compare with openclaw-github-repo-commander, gradio or hig-components-menus
mapbox-web-integration-patterns: common questions
Which Mapbox GL JS version does this skill recommend?
The source recommends v3.x, with v3.0.0 as the minimum. It notes that v3 requires WebGL 2.
Does this skill cover Vue and Svelte?
Yes. The source lists Vue and Svelte reference files with lifecycle patterns, and it includes a Vue-specific warning about storing the map in data().
How does the skill handle Mapbox tokens?
The source recommends environment variables for the access token in production and shows both global and per-map token options.
How do I install mapbox-web-integration-patterns?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is mapbox-web-integration-patterns free?
The code is published under the MIT licence. The service it connects to may have its own pricing.
Is mapbox-web-integration-patterns safe to use?
It scores 74 of 100. Grades: maintenance A, licence A, quality B. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to mapbox-web-integration-patterns?
Similar skills: openclaw-github-repo-commander, gradio, hig-components-menus, fastapi-templates.
