Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

csath/react-native-reanimated-text-input

Repository files navigation

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 name Type
error string - error text to display if any error available
errorColor color - color to decorate text input border and error text
errorTextStyle Text style - styles to override error text styles
textInputStyle Input style - style obj to oveerride text input styles
containerStyle View style - style to override textinput container (EG: padding , margins)
labelTextStyle Text style - styles to override label(placeholder) text style
isKeyboardInput boolean - default true, if false this will not open keboard, instead give a callback via onPress if this is false
onPress function - function to execute onPress in isKeyboardInput = true
labelTextColor color - default label(placeholder) color if labelTextStyle is not set
activeLabelColor color - default label(placeholder) color if labelTextStyle is not set and label is floaing on top(text input is active)
activeColor color - 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

About

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

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

AltStyle によって変換されたページ (->オリジナル) /