1.0.2 • Published 1 month ago

react-weblineindia-text-box v1.0.2

Weekly downloads
3
License
MIT
Repository
github
Last release
1 month ago

ReactJS - Text Box Component

ReactJS based Text Box component used to specify an input field where the user can enter data.

Table of contents

Browser Support

ChromeFirefoxSafariEdgeIE
83.0 ✔77.0 ✔13.1.1 ✔83.0 ✔11.9 ✔

Demo

npm.io

Getting started

Install the npm package:

npm install react-weblineindia-text-box
#OR
yarn add react-weblineindia-text-box

Usage

Use the <react-weblineindia-text-box> component:

import React ,{ Component } from 'react';
import TextBox from 'react-weblineindia-text-box'

class Test extends Component {
    constructor(props) {
    super(props);
    this.state = {
      vData: ""
    };
    onChange(event){
      this.setState({
        vData : event.target.value
      })
    }
    render(){
    return (
      <div>
        <TextBox 
          value ={this.state.vData}
          onChange={this.onChange.bind(this)}
          placeholder ="Input here"
        />
      </div>
    )}
}

Available Props

PropTypedefaultDescription
idStringID for the input
nameStringName for the input
valuestringValue of the component
classnameobjectClass to the input
placeholderStringThe input field will get this placeholder text
hideBooleanfalseHide component
disabledBooleanfalseDisable component
tabindexNumber0Tab index of the component
maxlengthNumber25The input maxlength
regexRegExpThe input regex
autocompleteStringoffThe input of autocomplelete
typeStringtextType for the input
isnumberonlyBooleanfalseThe input field will get number value

Methods

NameDescription
onFocusGets triggered when the autocomplete input field receives focus.
onBlurGets triggered when the autocomplete input field loses focus.
onChangeGets triggered when the autocomplete results got changed.
onKeypressGets triggered when a key gets pressed.
onKeyDownGets triggered when a key gets down.
onKeyUpGets triggered when a key gets up.

Want to Contribute?

  • Created something awesome, made this code better, added some functionality, or whatever (this is the hardest part).
  • Fork it.
  • Create new branch to contribute your changes.
  • Commit all your changes to your branch.
  • Submit a pull request.

Collection of Components

We have built many other components and free resources for software development in various programming languages. Kindly click here to view our Free Resources for Software Development


Changelog

Detailed changes for each release are documented in CHANGELOG.md.

License

MIT

Keywords

react-weblineindia-textbox, react-weblineindia-text-box, react-textbox, text-input, reactjs-input, react-input-field, react-text-input