Voice input and speech-to-text workflow in a React app
Development

react-speech-recognition: Add Voice Input to React Apps

Editor | March 2, 2026 | 4 min read

react-speech-recognition is a React library that wraps the Web Speech API and exposes a clean hook-based API for voice-driven UI.

If your app needs speech-to-text input, command shortcuts, or accessibility-friendly interactions, this package gives you a fast starting point.

Package Snapshot

As of March 2, 2026, the npm package reports:

Install
npm install react-speech-recognition
Basic Usage
import React from "react"
import SpeechRecognition, { useSpeechRecognition } from "react-speech-recognition"

export default function Dictaphone() {
  const { transcript, listening, resetTranscript, browserSupportsSpeechRecognition } =
    useSpeechRecognition()

  if (!browserSupportsSpeechRecognition) {
    return <p>Your browser does not support speech recognition.</p>
  }

  return (
    <div>
      <p>Microphone: {listening ? "on" : "off"}</p>
      <button onClick={() => SpeechRecognition.startListening()}>Start</button>
      <button onClick={() => SpeechRecognition.stopListening()}>Stop</button>
      <button onClick={resetTranscript}>Reset</button>
      <p>{transcript}</p>
    </div>
  )
}
Practical Features You Will Use
  • transcript: current recognized speech text
  • listening: microphone active state
  • startListening and stopListening: microphone control
  • resetTranscript: clear local transcript state
  • commands: phrase matching for voice actions
Production Notes
  1. Browser support for native Web Speech API is uneven, so test your real target devices.
  2. Use a polyfill strategy if your app needs broader cross-browser consistency.
  3. Handle microphone permission denial with clear fallback UI.
  4. Avoid auto-starting mic without user intent; require explicit interaction.
Final Take

react-speech-recognition is a practical choice when you want to add voice input quickly in React without building speech recognition plumbing from scratch.