All skills

Practical playbook for React teams to choose and apply reactuse hooks across state, async flows, browser APIs, and UI interactions. Use it when replacing custom hook logic with production-ready patterns that stay compatible with SSR and Next.js.

Use this Skill: https://skilld.dev/gh/siberiacancode/agent-skills/reactuse

This session only. Nothing lands on disk.

rulesuseSpeechRecognition.md

≈689 tokens on demand. Your agent reads this file only when SKILL.md points to it.

useSpeechRecognition

Turns browser speech recognition into React state so voice input can be started, stopped, aborted, and rendered as transcript text.

Usage

import { useSpeechRecognition } from "@siberiacancode/reactuse";

const speech = useSpeechRecognition();

Example

import { useSpeechRecognition } from "@siberiacancode/reactuse";

export const VoiceNote = () => {
  const speech = useSpeechRecognition({ language: "en-US" });

  if (!speech.supported) return <div>Not supported</div>;

  return (
    <div>
      <button onClick={() => speech.toggle()}>
        {speech.listening ? "Stop" : "Start"}
      </button>
      <div>Transcript: {speech.transcript}</div>
    </div>
  );
};

continuous:

const speech = useSpeechRecognition({ continuous: true });

interimResults:

const speech = useSpeechRecognition({ interimResults: true });

language:

const speech = useSpeechRecognition({ language: "ru-RU" });

maxAlternatives:

const speech = useSpeechRecognition({ maxAlternatives: 3 });

abort:

const speech = useSpeechRecognition();
speech.abort();

grammars:

const speech = useSpeechRecognition({ grammars });

onStart:

const speech = useSpeechRecognition({ onStart: () => console.log("start") });

onEnd:

const speech = useSpeechRecognition({ onEnd: () => console.log("end") });

onError:

const speech = useSpeechRecognition({
  onError: (error) => console.error(error),
});

onResult:

const speech = useSpeechRecognition({
  onResult: (event) => console.log(event),
});

Notes

Type Declarations

export interface UseSpeechRecognitionOptions {
  continuous?: SpeechRecognition["continuous"];
  grammars?: SpeechRecognition["grammars"];
  interimResults?: SpeechRecognition["interimResults"];
  language?: SpeechRecognition["lang"];
  maxAlternatives?: SpeechRecognition["maxAlternatives"];
  onEnd?: () => void;
  onError?: (error: SpeechRecognitionErrorEvent) => void;
  onResult?: (event: SpeechRecognitionEvent) => void;
  onStart?: () => void;
}
export interface UseSpeechRecognitionReturn {
  error: SpeechRecognitionErrorEvent | null;
  final: boolean;
  listening: boolean;
  recognition?: SpeechRecognition;
  supported: boolean;
  transcript: string;
  start: () => void;
  stop: () => void;
  abort: () => void;
  toggle: (value?: boolean) => void;
}
export declare const useSpeechRecognition: (
  options?: UseSpeechRecognitionOptions
) => UseSpeechRecognitionReturn;

Source: SKILL.md on GitHub

No alerts16d4 checks · Risk SAFE
  • Gen Agent Trust Hub16d

    The skill is a comprehensive documentation and implementation guide for the Reactuse hook library, designed for React and Next.js projects. It provides clear rules, usage examples, and type declarations for a wide range of hooks, including those interacting with browser APIs. No malicious patterns, obfuscation, or security risks were detected.

  • Socket5mo

    No alerts

  • Snyk16d

    Risk: LOW · No issues

  • Runlayer6mo

    1/166 files flagged

Signed by skilld at a090849. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 weeks ago.

Activeupdated last month
metadata
{
  "author": "siberiacancode",
  "version": "1.0.16"
}

README badge

README badge for siberiacancode/agent-skills/reactuse