react-praise
TypeScript icon, indicating that this package has built-in type declarations

1.0.4 • Public • Published

react-praise

Do React things with your voice.

This is a project that binds the (experimental) voice-invoked function tool, Praise, with React, allowing a user to use SpeechRecognition within React. Please keep in mind that this API is experimental and that this tool comes with all of the standard caveats of Praise.

Getting Started

  • yarn add praise react-praise to your already existing React app.

Usage

react-praise gives you a component whose children get the return value of a voice-invoked function. For example, here's how you can display everything a user says.

Edit react-praise demo

import React from "react";
import { render } from "react-dom";
import Praise from "react-praise";
 
import "./index.css";
 
const myPhrases = {
  "*": phrase => "You said " + phrase
};
 
const MyAppWithVoice = props => (
  <Praise phrases={myPhrases}>{output => <h2>{output}</h2>}</Praise>
);
 
render(<MyAppWithVoice />, document.getElementById("root"));

Options

react-praise supports all of the options that Praise does, but as props; React-style.

Examples

/react-praise/

    Package Sidebar

    Install

    npm i react-praise

    Weekly Downloads

    2

    Version

    1.0.4

    License

    MIT

    Unpacked Size

    11.8 kB

    Total Files

    6

    Last publish

    Collaborators

    • tejaskumar