2.1.10 • Published 5 years ago

react-floating-input v2.1.10

Weekly downloads
25
License
MIT
Repository
bitbucket
Last release
5 years ago

react-floating-input

Customizable floating label input for react.
Compatiable with redux-form. Feel free to create pull requests or contact the developer mayerlench1314@gmail.com for issues

Link with all examples!

DEMO - React Input Float

Demo GIF

alt text

Usage

import InputFloat from 'react-floating-input'

class DemoInput extends Component {
    state = {
        inputVal: ''
    }

    render() {
          <InputFloat
            value={this.state.inputVal}
            onChange={({ target }) => this.setState({ inputVal: target.value })}
            placeholder="Floating Input" 
           />
        )
    }
}

Properties

InputFloat.propTypes = {
  onChange: PropTypes.func,
  onKeyPress: PropTypes.func,
  placeholder: PropTypes.string,
  name: PropTypes.string,
  type: PropTypes.string, //default: 'text'
  value: PropTypes.string,
  hideBar: PropTypes.bool,
  disabled: PropTypes.bool, //defaults hideBar to true and makes input not editable
  staticLabel: PropTypes.bool,
  labelZoom: PropTypes.bool, //Will zoom the placeholder when focused

  //Choose your colors
  color: PropTypes.string, //default: '#999' when input is not focused
  activeColor: PropTypes.string,  //default: '#007BFF' when input is focused
}

Redux Form Usage

import { Field } from 'redux-form'
import { InputFloat } from 'react-floating-input'

//Any props on the Fields component get passed to InputFloat 
<Field component={InputFloat} type="text" name="email" placeholder="Email"  />

License

MIT

2.1.10

5 years ago

2.1.8

5 years ago

2.1.7

5 years ago

2.1.6

5 years ago

2.1.5

5 years ago

2.1.4

5 years ago

2.1.3

5 years ago

2.1.2

5 years ago

2.1.1

6 years ago

2.1.0

6 years ago

2.0.4

6 years ago

2.0.3

6 years ago

2.0.2

6 years ago

2.0.1

6 years ago

2.0.0

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago