AutoSuggest Component
To add a what3words field with AutoSuggest to your website (we call this the AutoSuggest Component), follow these simple steps:
Step 1: Choose API key
You will need a valid API key in order to use this component within your website.
Step 2: Customise the AutoSuggest Component
The preview and code change as you type. See the tutorial for every attribute.
Type a 3 word address, for example filled.count.so, and choose a suggestion.
The real component, run through this site with its demo key. Your code uses YOUR_API_KEY.
Step 3: Add the component to a form
Add these scripts between the <head></head> tags.
<script type="module" src="https://cdn.what3words.com/javascript-components@5.0.5/dist/what3words/what3words.esm.js"></script> <script nomodule src="https://cdn.what3words.com/javascript-components@5.0.5/dist/what3words/what3words.js"></script>Add the component within an HTML form element.
<what3words-autosuggest api_key="YOUR_API_KEY"> <input type="text" placeholder="e.g. ///lock.spout.radar" autocomplete="off" /> </what3words-autosuggest>
Follow the full instructions in the AutoSuggest Component tutorial to add it to your own page.