A <FloatingLabelInput>
component for react-native. This is still very much a work
in progress and only handles the simplest of cases, ideas and
contributions are very welcome.
Add it to your project
- Run
npm install rn-floating-label-input --save
import FloatingLabelInput from 'rn-floating-label-input';
Usage
'use strict'; var React = ; ; ; Component { superprops context; thisstate = dirty: false ; } { console; } { return <View style=stylescontainer> <FloatingLabelInput labelStyle=styleslabelInput inputStyle=stylesinput style=stylesformInput value='john@email.com' onBlur=thisonBlur > Email </FloatingLabelInput> <FloatingLabelInput labelStyle=styleslabelInput inputStyle=stylesinput style=stylesformInput > First Name </FloatingLabelInput> <FloatingLabelInput labelStyle=styleslabelInput inputStyle=stylesinput style=stylesformInput > Last Name </FloatingLabelInput> </View> ; }; var styles = StyleSheet; AppRegistry;
Additional Props:
FloatingLabelInput is just like any TextInput. It supports the below mentioned events handlers:
Following properties of TextInput are supported:
- autoCapitalize
- autoCorrect
- autoFocus
- bufferDelay
- clearButtonMode
- clearTextOnFocus
- controlled
- editable
- enablesReturnKeyAutomatically
- keyboardType
- multiline
- password
- returnKeyType
- selectTextOnFocus
- selectionState
- style
- testID
- value
Following events are supported:
- onBlur
- onChange
- onChangeText
- onEndEditing
- onFocus
- onSubmitEditing
MIT Licensed