|
| 1 | +--- |
| 2 | +title: VoiceSearch |
| 3 | +type: widget |
| 4 | +info: | |
| 5 | + The icon is from <a href="https://feathericons.com/" target="_blank">Feather icons</a>. Its license is MIT and the attribution is not needed according to <a href="https://github.com/feathericons/feather/issues/95" target="_blank">this</a>. |
| 6 | +html: | |
| 7 | + <div class="ais-VoiceSearch"> |
| 8 | + <button class="ais-VoiceSearch-button" type="button" title="Search by voice"> |
| 9 | + <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-mic"> |
| 10 | + <path d="M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z"></path> |
| 11 | + <path d="M19 10v2a7 7 0 0 1-14 0v-2"></path> |
| 12 | + <line x1="12" y1="19" x2="12" y2="23"></line> |
| 13 | + <line x1="8" y1="23" x2="16" y2="23"></line> |
| 14 | + </svg> |
| 15 | + </button> |
| 16 | + <div class="ais-VoiceSearch-status"> |
| 17 | + <p>Amazon Fire tablet</p> |
| 18 | + </div> |
| 19 | + </div> |
| 20 | +alt1: Recognizing speech |
| 21 | +althtml1: | |
| 22 | + <div class="ais-VoiceSearch"> |
| 23 | + <button class="ais-VoiceSearch-button" type="button" title="Search by voice"> |
| 24 | + <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-mic"> |
| 25 | + <path d="M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z" fill="currentColor"></path> |
| 26 | + <path d="M19 10v2a7 7 0 0 1-14 0v-2"></path> |
| 27 | + <line x1="12" y1="19" x2="12" y2="23"></line> |
| 28 | + <line x1="8" y1="23" x2="16" y2="23"></line> |
| 29 | + </svg> |
| 30 | + </button> |
| 31 | + <div class="ais-VoiceSearch-status"> |
| 32 | + <p>Amazon Fire tablet</p> |
| 33 | + </div> |
| 34 | + </div> |
| 35 | +alt2: Disabled on unsupported browser |
| 36 | +althtml2: | |
| 37 | + <div class="ais-VoiceSearch"> |
| 38 | + <button class="ais-VoiceSearch-button" type="button" title="Search by voice" disabled> |
| 39 | + <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-mic"> |
| 40 | + <path d="M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z"></path> |
| 41 | + <path d="M19 10v2a7 7 0 0 1-14 0v-2"></path> |
| 42 | + <line x1="12" y1="19" x2="12" y2="23"></line> |
| 43 | + <line x1="8" y1="23" x2="16" y2="23"></line> |
| 44 | + </svg> |
| 45 | + </button> |
| 46 | + <div class="ais-VoiceSearch-status"> |
| 47 | + <p></p> |
| 48 | + </div> |
| 49 | + </div> |
| 50 | +classes: |
| 51 | + - name: .ais-VoiceSearch |
| 52 | + description: the root div of the widget |
| 53 | + - name: .ais-VoiceSearch-button |
| 54 | + description: the button to trigger the voice search |
| 55 | + - name: .ais-VoiceSearch-status |
| 56 | + description: the status of the voice search |
| 57 | +options: |
| 58 | + - name: searchAsYouSpeak |
| 59 | + default: false |
| 60 | + description: If you enable this option, new searches will be triggered every time speech recognition generates interim transcript while speaking. |
| 61 | +--- |
0 commit comments