An open API service indexing awesome lists of open source software.

https://github.com/tejasq/react-praise

A React binding for Praise.
https://github.com/tejasq/react-praise

react speech-recognition web-speech-api

Last synced: 4 months ago
JSON representation

A React binding for Praise.

Awesome Lists containing this project

README

          

# react-praise

> Do React things with your voice.

This is a project that binds the (experimental) [voice-invoked function tool, Praise](https://github.com/tejasq/praise), with React, allowing a user to use [SpeechRecognition](https://developer.mozilla.org/en-US/docs/Web/API/SpeechRecognition) within [React](https://reactjs.org/). 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](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/rvr80nr9m)

```jsx
import React from "react";
import { render } from "react-dom";
import Praise from "react-praise";

const myPhrases = {
"*": phrase => "You said " + phrase
};

const MyAppWithVoice = props => (
{output =>

{output}

}
);

render(, document.getElementById("root"));
```

### Options

react-praise supports all of the options that [Praise](https://github.com/tejasq/praise) does, but as props; React-style.

## Examples

* [JSConf EU 2018 Slides](https://github.com/tejasq/jsconf-eu-2018-slides) by me.