1.0.1 • Published 6 years ago

react-input-field-with-label v1.0.1

Weekly downloads
11
License
-
Repository
github
Last release
6 years ago

react-input-field-with-label

A nifty input field and label for React.

Installation

npm install react-input-field-with-label --save

or

yarn add react-input-field-with-label

Usage

import InputField from 'react-input-field-with-label'

class App extends Component {
  constructor(){
    super()
    this.someFunction = this.someFunction.bind(this)
  }

  someFunction(e){
    e.preventDefault()
    console.log(e.target.value)
  }

  render() {
    return (
      <div>
        <InputField
          label={'Full name'}
          getFieldInput={(e) => this.someFunction(e)}
          placeholder={'Luke Skywalker'}
          inputFieldStyling={'inputClass'}
          labelStyling={'labelClass'}
        />
      </div>
    );
  }
}

export default App;

InputField Stying

CSS class names should be applied to both inputFieldStyling and labelStyling.

InputField props

PropsDefault valuesPossible values
labelnonestring
getFieldInputnullfunction
placeholdernonestring
inputFieldStylingnonestring
labelStylingnonestring