React Native Login Screen | Expo

0

 React Native Login Screen

Battle Tested ✅

One Line of Code to Plug & Play | Fully Customizable Beautiful React Native Login Screen

npm version npm Platform - Android and iOS License: MIT

React Native Login Screen

🥳 Version 4

Version 4 with the completely new UI

  • Whole new UI / UX
  • Simplistic Design
  • Better Code Quality
  • Fully Customizable
  • Ready to use SocialButton Component
  • Removed unstable dependencies
  • Only ONE dependency is needed

Installation

Add the dependency:

npm i react-native-login-screen

Peer Dependencies

IMPORTANT! You need install them.
npm i react-native-text-input-interactive
"react-native-text-input-interactive": ">= 0.1.3"

Import

import LoginScreen from "react-native-login-screen";

Usage

<LoginScreen
  logoImageSource={require("./assets/logo-example.png")}
  onLoginPress={() => {}}
  onSignupPress={() => {}}
  onEmailChange={(email: string) => {}}
  onPasswordChange={(password: string) => {}}
/>

Usage with Social Button

Of course you can put any children into the LoginScreen, I recommend you to use SocialButton.

import LoginScreen, { SocialButton } from "react-native-login-screen";

<LoginScreen
  logoImageSource={require("./assets/logo-example.png")}
  onLoginPress={() => {}}
  onSignupPress={() => {}}
  onEmailChange={(email: string) => {}}
  onPasswordChange={(password: string) => {}}
>
  <SocialButton text="Continue with Google" onPress={() => {}} />
  <SocialButton
    text="Continue with Facebook"
    imageSource={require("./assets/social/facebook.png")}
    onPress={() => {}}
  />
  <SocialButton
    text="Continue with Twitter"
    imageSource={require("./assets/social/twitter.png")}
    onPress={() => {}}
  />
</LoginScreen>;

Configuration - Props

Fundamentals

PropertyTypeDefaultDescription
onLoginPressfunctionundefinedset your own function when the login button is pressed
onSignupPressfunctionundefinedset your own function when the Create an account is pressed
onEmailChangefunctionundefinedset your own function when email textinput has a change
onPasswordChangefunctionundefinedset your own function when password textinput has a change
logoImageSourcesourceundefinedset your own logo

Customizations (Optional)

PropertyTypeDefaultDescription
signupTextstring"Create an account"change the sign up text
disableSignupbooleanfalsedisable the signup if you do not want to use it
disableDividerbooleanfalsedisable the divider if you do not want to use it
disableSocialButtonsbooleanfalsedisable the all social buttons
disablePasswordInputbooleanfalsedisable the password text input
emailPlaceholderstring"Email"change email placeholder text
passwordPlaceholderstring"Password"change password placeholder text
loginButtonTextstring"Login"change login button's text
styleViewStyledefaultset/override the default style for the container
dividerStyleViewStyledefaultset/override the default divider style
logoImageStyleImageStyledefaultset/override the default image style
textInputContainerStyleViewStyledefaultset/override the default text input container style
loginButtonStyleViewStyledefaultset/override the default login button style
loginTextStyleTextStyledefaultset/override the default login text style
signupStyleViewStyledefaultset/override the default signup button style
signupTextStyleTextStyledefaultset/override the default signup text style
textInputPropsIInteractiveTextInputPropsdefaultset/override the default textinput props

Default Social Login Buttons (Optional)

PropertyTypeDefaultDescription
onFacebookPressfunctionundefinedset your own function for the Facebook social button press
onTwitterPressfunctionundefinedset your own function for the Twitter social button press
onApplePressfunctionundefinedset your own function for the Apple social button press
onDiscordPressfunctionundefinedset your own function for the Discord social button press

Version 2 is still available

if you do not like the new design, you can still use the old design :)

npm i react-native-login-screen@2.1.4

Roadmap

  •  LICENSE
  •  Android Design Bug Fixes
  •  Configuration - Props COMING SOON
  •  Typescript Challenge!
  •  Remove some dependencies
  •  Better TextField Library Integration
  •  Write an article about the lib on Medium
  •  Write an article about the lib on DevTO

Credits

For the awesome photo thanks to jcob nasyr from Unsplash

Author

FreakyCoder, kurayogun@gmail.com

License

React Native Login Screen is available under the MIT license. See the LICENSE file for more info.




Post a Comment

0Comments
Post a Comment (0)