- Start with a predefined widget that you can configure and style with CSS.
- To change its render output (DOM or Native), customize a predefined widget to render what you want.
- To implement something that doesn’t exist, create a custom widget.
Predefined widgets
The recommended way to use InstantSearch is with its predefined widgets such asais-search-box
.
InstantSearch includes a set of widgets that are most often used in search experiences.
Widgets provide features and a rendered output.
You can place them anywhere on your UI, configure them, and style them with CSS.
For example, add the ais-refinement-list
` widget and ask it to show a list of brands, so your users can refine their search using those brands.
Vue
Within the Vue InstantSearch documentation, widgets are components, and vice-versa.
When you see the word widget in this documentation, consider it as a Vue component.
The InstantSearch wrapper
Theais-instant-search
wrapper communicates between your app and Algolia.
This is where you add all the widgets.
It accepts a search client and an index name.
Vue
CSS theme
The predefined widgets in Vue InstantSearch are compatible with the default CSS theme:
Customize widgets
Algolia’s predefined widgets, with their fixed behavior and output, may not fully meet your requirements. For example, you might want to customize the rendering of theais-menu
widget to display as a select
element instead of a list of links. You may also want to render it as a keyboard-controlled slideshow of images.
To address these limitations, Vue InstantSearch uses “connectors” to redefine widget behavior and DOM output.
For more information, see Customize a Vue InstantSearch widget.