1.0.1 • Published 4 years ago

react-native-reanimated-text-input v1.0.1

Weekly downloads
29
License
MIT
Repository
github
Last release
4 years ago

react-native-reanimated-text-input npm npm

React Native text input component with a floating label - using react-native-reanimated.

Peer Dependancies

react-native-reanimated 

Demo

Alt text

Installation

yarn add react-native-reanimated-text-input

or

npm install --save react-native-reanimated-text-input

Usage

import Input from 'react-native-reanimated-text-input';

 <Input
          label={"User name"}
          value={userName}
          onChangeText={(t) => setUserName(t)}
          activeColor={'green'}
          activeLabelColor={'green'}
          containerStyle={{ marginVertical: 20 }}
          onBlur={() => !userName ? setUsernameError('User name is mandotory') : null}
          error={usernameError}
 />

Prop-types

Prop nameType
errorstring - error text to display if any error available
errorColorcolor - color to decorate text input border and error text
errorTextStyleText style - styles to override error text styles
textInputStyleInput style - style obj to oveerride text input styles
containerStyleView style - style to override textinput container (EG: padding , margins)
labelTextStyleText style - styles to override label(placeholder) text style
isKeyboardInputboolean - default true, if false this will not open keboard, instead give a callback via onPress if this is false
onPressfunction - function to execute onPress in isKeyboardInput = true
labelTextColorcolor - default label(placeholder) color if labelTextStyle is not set
activeLabelColorcolor - default label(placeholder) color if labelTextStyle is not set and label is floaing on top(text input is active)
activeColorcolor - border color when the text input is active
{...props}TextInput props - All react native text input props

Example

checkout example/test directory and findout a react-native app.

yarn android

or

yarn ios