Typix LogoTypix
Extensions

Speech to Text

Voice dictation via the Web Speech API

Adds a dictation mode to the editor. Click the mic button (or trigger the command) and start speaking — the transcript appears at the cursor.

Install

pnpm add @typix-editor/extension-speech-to-text

Live demo

Browser support check

import { isSpeechRecognitionSupported } from "@typix-editor/extension-speech-to-text";

if (isSpeechRecognitionSupported()) {
  // Web Speech API is available
}

Commands

import {
  TYPIX_TOGGLE_SPEECH_TO_TEXT,
  SPEECH_TO_TEXT_COMMAND,
} from "@typix-editor/extension-speech-to-text";

// Toggle dictation on/off
editor.lexical.dispatchCommand(TYPIX_TOGGLE_SPEECH_TO_TEXT, undefined);

// Force-set state
editor.lexical.dispatchCommand(SPEECH_TO_TEXT_COMMAND, true);

Voice commands

The extension supports custom voice commands (e.g., "new paragraph", "capitalize") via the VoiceCommands config:

import type { VoiceCommands } from "@typix-editor/extension-speech-to-text";

Vendor the UI

npx typix ui add speech-to-text

Speech recognition uses the browser's native Web Speech API. Availability varies — Chrome and Edge are best supported. Safari and Firefox have partial support.

On this page