react-native-floating-labels
A <FloatingLabel>
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 react-native-floating-labels --save
var FloatingLabel = require('react-native-floating-labels');
Usage
'use strict'; var React = ; var FloatingLabel = ; var AppRegistry StyleSheet View = React; Component { superprops context; thisstate = dirty: false ; } { console; } { return <View style=stylescontainer> <FloatingLabel labelStyle=styleslabelInput inputStyle=stylesinput style=stylesformInput value='john@email.com' onBlur=thisonBlur >Email</FloatingLabel> <FloatingLabel labelStyle=styleslabelInput inputStyle=stylesinput style=stylesformInput >First Name</FloatingLabel> <FloatingLabel labelStyle=styleslabelInput inputStyle=stylesinput style=stylesformInput >Last Name</FloatingLabel> </View> ; }; var styles = StyleSheet; AppRegistry;
Additional Props:
FloatingLabel 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