1.0.2 • Published 2 years ago

react-word-input v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

WordInput is a react functional component for input hinted word.

It take value as the hinted word and callback functions onComplete/onEnter which return the word entered by user.

Working Demo

Installation

This module is installed via npm:

npm install react-word-input

Usage

import './App.css';
import { WordInput } from 'react-word-input';

function App() {

  const print = (word) => {
    console.log(word);
  }

  return (
    <div className="App">
      <WordInput className='word' value={'W_R_ __P_T'} onChange={print} autoFocus />
    </div>
  );
}

export default App;

API

NameTypeRequiredDefaultDescription
onChangeFunctionfalse-Returns word everytime when word is changed
onCompleteFunctionfalse-Returns word when word is filled
onEnterFunctionfalse-Returns word when user press enter
valueStringtrue-The value of the hinted word
classNameStringfalse-Class for input element
disabledBooleanfalsefalseDisables the input
autoFocusBooleanfalsefalseAuto focuses input on initial page load
spellCheckBooleanfalsefalseCheck is word spells correct or not

Author

Satyam Lohiya