All docschevron-rightMapbox Search JSchevron-rightarrow-leftReact Referencechevron-rightSearch Box

Search Box

lightning
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.

<SearchBox> is a React component that provides an interactive search box, powered by the Mapbox Search Box API.

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

Internally, this wraps the <mapbox-search-box> element.

Parameters

Example

export function Component() {
const [value, setValue] = React.useState('');
return (
<form>
<SearchBox accessToken={<your access token here>} />
</form>
);
}

SearchBoxProps

Instance Members