0.1.4 • Published 10 years ago

rn-flabel-textfield v0.1.4

Weekly downloads
22
License
-
Repository
github
Last release
10 years ago

React Native Floating Label TextField

A simple wrapper around 'TextInput'. Works both for iOS and Android. Note the wrapped TextField has no placeholder - the placeholder is 'simulated' by the floating label being down where the placeholder would normally be. I might later add a version which actually uses placeholder but for now, trying to use the placeholder causes issues with appearance.**

install

npm i --save rn-flabel-textfield

Props:

Accepts all TextField props plus the following:

PropertyTypeDefaultDescription
durationnumber250Animation duration
inactiveColorstring'dimgrey'Color of floating label when the TextInput has no focus or when the floating label is down
placeholderFontSizenumber15Font size of placeholder
flabelFontSizenumber12Font size of floating label
activeColorstring'#414Db1'Color of focused floating label
flabelPaddingnumber20Top padding of the floating label when it is down
flabelActivePaddingnumber0Top padding of the floating label when it is up
wrapperStyleobject{}Style for the View that wraps the floating label and the TextInput

example usage:

import FloatLabelTextField from 'rn-flabel-textfield'
...
<FloatLabelTextField
    placeholder={'Project Name'}
    onChangeText={newProject.setProjectName}
    value={newProject.name}
    style={{height: 60}}
    wrapperStyle={{marginTop: 15}}
/>

Example

Checkbox, TextInput and Floating label textinput

License: MIT

** small flicker when using Animated, which isn't there with LayoutAnimation which in turn causes blurry placeholder issues on iOS.

0.1.4

10 years ago

0.1.3

10 years ago

0.1.2

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago