Skip to main content
Signature

Import

To ensure optimal bundle sizes, see Optimize build size.
Vue

See this widget in action

Preview this widget and its behavior.

About this widget

The ais-search-box widget is used to let users set a text-based . This usually is the main entry point to start the search in an InstantSearch context. It’s usually placed at the top of a search experience, so that users can start searching right away.

Examples

Vue

Props

string
default:"Search here…"
The input placeholder.
Vue
string
default:"search"
The submit button text.
Vue
string
default:"clear"
The clear button text.
Vue
boolean
default:false
Whether to automatically focus on the input when rendered.
Vue
boolean
default:false
since: v4.13.6
Whether to update the search state in the middle of a composition session. This is useful when users need to search using non-latin characters.
Vue
boolean
default:false
Whether to show the loading indicator (replaces the submit button if the search is stalled).
Vue
object
default:"{}"
The CSS classes you can override:
  • ais-SearchBox. The root element of the widget.
  • ais-SearchBox-form. The form element.
  • ais-SearchBox-input. The input element.
  • ais-SearchBox-submit. The submit button element.
  • ais-SearchBox-submitIcon. Magnifier icon used with The search input.
  • ais-SearchBox-reset. The reset button element.
  • ais-SearchBox-resetIcon. The reset button icon.
  • ais-SearchBox-loadingIndicator. The loading indicator element.
  • ais-SearchBox-loadingIcon. The loading indicator icon.
Vue

Customize the UI

The slot to override the complete DOM output of the widget.Note that when you implement this slot, none of the other slots will change the output, as the default slot surrounds them.Scope
  • currentRefinement: string: the current query used for the search.
  • isSearchStalled: boolean: whether InstantSearch has detected that searches are stalled.
  • refine: (string) => void: the function to change the query.
Vue
The slot to override the DOM output of the submit icon.ScopeNo props are provided.
Vue
The slot to override the DOM output of the reset icon.ScopeNo props are provided.
Vue
The slot to override the DOM output of the loading indicator.ScopeNo props are provided.
Vue

HTML output

HTML
Last modified on July 22, 2026