Skip to main content
Use InstantSearch.js in your Angular projects to manage state and build custom search interfaces. This approach lets you build a custom search solution without relying on Angular InstantSearch, which isn’t compatible with the latest Angular versions. This simplifies development and gives you full control of your search interface.

Explore source code

Browse the source for the InstantSearch.js in Angular quickstart example on GitHub.

Base use-case

Rather than adding InstantSearch to a component directly, store the instance in a service and expose utility methods. You can reuse a single instance across multiple components and start it from just one component.
JavaScript
Inject this service into any component to access the InstantSearch instance:
Javascript
Add widgets in any component using the service, whether in the constructor or ngOnInit. Start the instance in a single component with ngAfterContentInit. Use connectors to track state changes and bind data to your components.
JavaScript
This lets you have multiple widgets in a single component. The template automatically re-renders when the state updates with new results:
HTML

Server-side rendering and routing

Because this service reads the Angular Router’s initial state, routing integration works out of the box. Server-side rendering also works without extra code, as Angular renders the page with the initial state coming from the network request.
JavaScript

Multi-index

The index widget supports multiple indices.
JavaScript
Last modified on May 19, 2026