The what3words javascript components package extends the [JS API](https://github.com/what3words/w3w-node-wrapper) and builds custom web components for use in static HTML documents, [Angular](https://angularjs.com), [ReactJS](https://reactjs.com), and [Vue
npm install @what3words/javascript-componentsThe what3words javascript components package extends the JS API and builds custom web components for use in static HTML documents, Angular, ReactJS, and Vue.
Some bundlers require additional configuration to work with our components.
When using vite, make sure to exclude @what3words/javascript-components from the dependency optimization using the optimizeDeps.exclude option in your vite.config.[js,ts] file
``js
import { defineConfig } from "vite";
export default defineConfig({
...
optimizeDeps: {
exclude: ["@what3words/javascript-components"],
},
});
`
#### Configuration
##### Script Parameters
When using the CDN to load this package, you can provide query string parameters to the
nomodule
defer
src="https://cdn.what3words.com/javascript-components@5.0.5/dist/what3words/what3words.js"
>
...
...
`
##### NPM
`bash`
npm install @what3words/javascript-components@5.0.5
#### Usage
`html`
id="search-input"
type="text"
placeholder="Find your address"
autocomplete="off"
/>
#### Installation
##### CDN
`html`
type="module"
defer
src="https://cdn.what3words.com/javascript-components@5.0.5/dist/what3words/what3words.esm.js"
>
nomodule
defer
src="https://cdn.what3words.com/javascript-components@5.0.5/dist/what3words/what3words.js"
>
...
...
##### NPM
`bash`
npm install @what3words/javascript-components@5.0.5
#### Usage
`html`
...
api_key="
map_api_key="
disable_default_ui
fullscreen_control
map_type_control
zoom_control
current_location_control_position="9"
fullscreen_control_position="3"
search_control_position="2"
words="filled.count.soap"
>
id="search-input"
type="text"
placeholder="Find your address"
autocomplete="off"
/>
#### Installation
##### CDN
`html`
type="module"
defer
src="https://cdn.what3words.com/javascript-components@5.0.5/dist/what3words/what3words.esm.js"
>
nomodule
defer
src="https://cdn.what3words.com/javascript-components@5.0.5/dist/what3words/what3words.js"
>
...
...
##### NPM
`bash`
npm install @what3words/javascript-components@5.0.5
#### Usage
##### Input Slot - Text Area Element
`html`
slot="input"
name="delivery-notes"
placeholder="Type delivery instructions with your what3words address"
>
##### Input Slot - Input Element
`html`
slot="input"
type="text"
name="delivery-notes"
placeholder="Type delivery instructions with your what3words address"
autocomplete="off"
/>
##### Tooltip Slot
`html``
slot="input"
name="delivery-notes"
placeholder="Type delivery instructions with your what3words address"
autocomplete="off"
>
Did you know?
You can add a
href="https://delivery.w3w.co"
target="_blank"
rel="noopener noreferrer"
>
what3words
address to help our delivery partners find you first time
e.g. ///limit.boom.field
##### Last Updated: 03/11/2025
##### Version: 5.0.5