InstantSearch / Angular / V4 / API reference

Ais-Voice-Search | Angular InstantSearch V4 (Deprecated)

Deprecated content
Angular InstantSearch is deprecated. Please use InstantSearch.js instead. For more information, see Migrating from Angular InstantSearch.

Signature

Signature
<ais-voice-search
  // Optional parameters
  [searchAsYouSpeak]="boolean"
></ais-voice-search>

Import

1
2
3
4
5
6
7
8
import { NgAisVoiceSearchModule } from 'angular-instantsearch';

@NgModule({
  imports: [
    NgAisVoiceSearchModule,
  ],
})
export class AppModule {}

1. Follow additional steps in Optimize build size to ensure your code is correctly bundled.
2. This imports all the widgets, even the ones you don’t use. Read the Getting started guide for more information.

About this widget

The ais-voice-search widget lets users perform a voice-based query.

It uses the Web Speech API, which only Chrome (from version 25) has implemented so far. This means the voiceSearch widget only works on desktop Chrome and Android Chrome. It doesn’t work on iOS Chrome, which uses the iOS WebKit.

Examples

1
<ais-voice-search></ais-voice-search>

Props

searchAsYouSpeak

Optional
Type: boolean

Whether to trigger the search as you speak. If false, search is triggered only after speech is finished. If true, search is triggered whenever the engine delivers an interim transcript.

1
2
3
<ais-voice-search
  [searchAsYouSpeak]="true"
></ais-voice-search>

buttonTitle

Optional
Type: string

The title attribute on the button

1
2
3
<ais-voice-search
  buttonTitle="Voice Search"
></ais-voice-search>

disabledButtonTitle

Optional
Type: string

The title attribute on the button when it’s disabled on unsupported browsers

1
2
3
<ais-voice-search
  disabledButtonTitle="Voice Search Disabled"
></ais-voice-search>
Did you find this page helpful?