InstantSearch.js is a library for building blazing fast search-as-you-type search UIs with Algolia.
InstantSearch.js is part of the InstantSearch family: InstantSearch.js | React InstantSearch (web) | Vue InstantSearch (web) | Angular InstantSearch (web) | React-native InstantSearch (native) | InstantSearch Android (native) | InstantSearch iOS (native).
⚡ Lightning-fast search for your apps
This library is built and maintained by the contributors and the peeps at Algolia.
The documentation available at https://community.algolia.com/instantsearch.js/.
Using InstantSearch.js is as simple as adding this JS in your page:
var search = instantsearch({
appId: 'latency',
apiKey: '6be0576ff61c053d5f9a3225e2a90f76',
indexName: 'instant_search',
searchParameters: {
hitsPerPage: 8
}
});
search.addWidget(
instantsearch.widgets.hits({
container: document.querySelector('#products'),
templates: {
item: '{{{_highlightResult.name.value}}}'
}
})
);
search.addWidget(
instantsearch.widgets.searchBox({
container: document.querySelector('#searchBox'),
placeholder: 'Search for products',
autofocus: false /* Only to avoid live preview taking focus */
})
);
search.addWidget(
instantsearch.widgets.refinementList({
container: document.querySelector('#brand'),
attributeName: 'brand'
})
);
search.start();
You can see this live on CodeSandbox.
If you want to learn more about the library, you can follow the getting started or check how add it to your own project.
We currently support the last two versions of major browsers.
If you want support for IE11, we suggest you use polyfill.io.
We welcome all contributors, from casual to regular ❤️
If you find a typo in the doc, don't hesitate to click on the edit this page
button.
If you don't know where to start, you can check the open issue that are tagged easy, the bugs or chore.
To get started in your contribution, you just need to:
- fork the project and clone it locally
- install the dependencies
yarn
- run the dev mode
yarn run dev
and open dev-novel
If you want to learn more about the contribution process, read our CONTRIBUTING guide.