About
A microphone button that captures voice input and converts it to text using the Web Speech API, with a MediaRecorder fallback for browsers that lack native speech recognition.
Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Speech Input to your project and fits it to your theme.
Code
How Speech Input is used: the demo's code. The component's own source comes with a free account.
Usage.tsx
"use client";
import { SpeechInput } from "@/components/ui/speech-input";
import { useState } from "react";
export default function SpeechInputDemo() {
const [transcript, setTranscript] = useState("");
return (
<div className="flex flex-col items-center gap-4">
<SpeechInput onTranscriptionChange={(text) => setTranscript(text)} />
<p className="text-muted-foreground text-sm">
{transcript || "Click the microphone to start speaking"}
</p>
</div>
);
}








