Skip to Content

📩 Login Email

A production-ready, flexible email/password login screen for React Native apps. Built with react-hook-form, themed by the Zezo OTT UI Kit, and fully customizable via render props.


✨ Features

  • Email & password login with real-time validation
  • Built-in error handling with react-hook-form
  • Light/dark mode support via theming system
  • Optional background image and logo
  • Optional top-back button and bottom signup switch
  • Customizable UI with override renderers

📸 Preview

LoginEmail-Light
LoginEmail-Dark

🧠 Authentication Note

⚙️ First, setup the getZezoOtt API client: API Client Setup
🔗 Call getZezoOtt().auth.login() to authenticate the user.
📘 See method reference


👉 See Splash Screen Store Setup

🚀 Usage Example

EmailLoginScreen.tsx
import React from "react"; import { Auth } from "@zezosoft/zezo-ott-react-native-ui-kit"; import { goBack, navigate } from "@ZezoOtt/utils/NavigationUtil"; import { Route } from "@navigation/routes"; import { useSplashStore } from "@ZezoOtt/store/splashStore"; const EmailLoginScreen = () => { const { splash } = useSplashStore.getState(); return ( <Auth.LoginWithEmail logoUri={splash.logo} title="Welcome Back!" onSubmit={(data) => { console.log(data). //call your api endpoint method }} onForgotPassword={() => navigate(Route.ForgetPassword)} onTopBackBtnPress={() => goBack()} backgroundImage={{ source: splash.login_poster, gradientSplitBackground: 0.4, }} onSignup={() => navigate(Route.Register)} onSwitchToPhoneLogin={() => navigate(Route.LoginWithPhone)} /> ); }; export default EmailLoginScreen;

🔗 See related route definition: Route enum from @navigation/routes.ts


🔧 Props

📌 Core Configuration

PropTypeDescription
titlestringTitle shown above the form
logoUristringOptional logo image URL
minPasswordLengthnumberMinimum characters required for password
loadingSubmitBtnbooleanShow loading spinner on login button
themeAppThemeOptional theme override for light/dark mode

🔀 Handlers & Navigation

PropTypeDescription
onSubmit(form) => voidCalled when login form is submitted
onSignup() => voidNavigate to signup screen
onForgotPassword() => voidNavigate to forgot password screen
onSwitchToPhoneLogin() => voidSwitch to phone login screen
onTopBackBtnPress() => voidTriggered when top back button is pressed

🎨 Styling Props

PropTypeDescription
containerStyleViewStyleStyle override for main container
titleStyleTextStyleStyle override for title
formStyleViewStyleStyle override for form container
inputStyleTextStyleStyle override for input fields
inputContainerStyleViewStyleStyle override for input containers
topBackBtnStyleViewStyleStyle override for top back button
signupTextPropsTextStyleStyle for “Don’t have an account?” text
signupLinkTextPropsTextStyleStyle for “Sign Up” link text

📝 Customizable Text

PropTypeDescription
textobjectOverride default field labels and messages
 └── emailLabelstringLabel for the email field
 └── emailPlaceholderstringPlaceholder for the email field
 └── passwordLabelstringLabel for the password field
 └── passwordPlaceholderstringPlaceholder for the password field
 └── forgotPasswordstringText for the “Forgot Password?” link
 └── loadingSubmitBtnTextstringText while login button is loading
 └── loginButtonstringText for login button
 └── signupPromptstringPrompt before the sign-up link
 └── signupLinkstringText for the sign-up link
 └── switchToPhoneLoginstringText for the switch to phone login button

🖼️ Background Image

PropTypeDescription
backgroundImageobjectBackground image settings
 └── sourcestring | nullImage URL or path
 └── resizeMode'cover' | 'contain' | 'stretch' | 'repeat'How the background image should resize
 └── onImageError(error: Error) => voidError handler when image fails to load
 └── gradientSplitBackgroundnumberPosition of gradient split (e.g. 0.4)

🧩 Custom Renderers

PropTypeDescription
renderLogo() => ReactNodeCustom component for logo
renderEmailHeader() => ReactNodeCustom header above the email field
renderSubmitButton(props) => ReactNodeCustom renderer for submit button
renderForgotPassword() => ReactNodeCustom renderer for forgot password link
renderSignupPrompt(props: { onPress: () => void }) => ReactNodeCustom sign-up prompt renderer
renderTopBackBtn(props: { onPress: () => void }) => ReactNodeCustom top back button renderer
renderSwitchToPhoneLogin(props: { onPress: () => void }) => ReactNodeCustom phone login switch renderer

🧪 Validation

  • Email is required and must follow a valid format
  • Password is required, minimum 6 characters

📝 Default Texts

If text prop is not provided, the following defaults are used:

{ emailLabel: 'Email', emailPlaceholder: 'Enter your email', passwordLabel: 'Password', passwordPlaceholder: 'Enter your password', forgotPassword: 'Forgot Password?', loadingSubmitBtnText: 'Logging in...', loginButton: 'Login', signupPrompt: "Don't have an account?", signupLink: 'Sign Up', switchToPhoneLogin: 'Login With Phone' }

🎨 Theming

  • Auto light/dark mode detection
  • Override styles via theme prop
  • Optional gradient and image support

✍️ Created by Naresh Dhamu – Powered by ZezoSoft

Last updated on