Skip to main content


Public beta for Mapbox Search JS
Mapbox Search JS is in public beta. During the public beta phase, frameworks may be subject to potential changes as they stabilize.

Geocoding is a custom HTML element that renders a UI search component, allowing users to forward and reverse geocode search and control a Mapbox GL JS map.

This page includes reference documentation for the MapboxGeocoder element, part of the Mapbox Search JS Web framework.

For installation instructions and a helpful introduction to using Address Confirmation in your website or app, see our Web Geocoding Quickstart Guide.

HTML Custom Element


MapboxGeocoder, also available as the element <mapbox-geocoder>, is an element that lets you search for addresses and places using the Mapbox Geocoding API.

It can control a Mapbox GL JS map to zoom to the selected result.

Additionally, MapboxGeocoder implements the IControl interface.

To use this element, you must have a Mapbox access token.

new MapboxGeocoder()


const search = new MapboxGeocoder();
search.accessToken = '<your access token here>';
access-token="<your access token here>"

Instance Members

Map settings


Map binding


Was this section on MapboxGeocoder helpful?
Was this page helpful?