Phone Login

A full-featured phone login form with country code selector and customizable branding

Zezo Phone Login Component

Loading...

📦 Installation

pnpm dlx shadcn@latest add https://zezo-ui.vercel.app/r/zezo-auth.json

💡 Usage Example

import PhoneLogin from "@/components/zezo/auth/PhoneLogin";

<PhoneLogin
  onSubmit={(data) => {
    console.log("Country Code:", data.countryCode);
    console.log("Phone Number:", data.phoneNumber);
  }}
  showConsent={true}
  isLoading={false}
  error=""
  goBack={() => window.history.back()}
/>

📘 Props

PropTypeRequiredDescription
onSubmit(data: { countryCode: string; phoneNumber: string }) => voidOptionalCallback function called when form is submitted
goBack() => voidOptionalCallback for back navigation (shows back button)
isLoadingbooleanOptionalLoading state for submit button (default: false)
errorstringOptionalError message displayed in red below form
showConsentbooleanOptionalShow consent checkbox for OTP verification (default: false)
logoUrlstringOptionalURL of logo image displayed at top (has default)
posterUrlstringOptionalRight side poster/image URL (hidden on mobile, has default)
titlestringOptionalMain heading text (default: "Welcome back!")
subtitlestringOptionalSubtitle text below title (default: "Enter your phone number to login")
continueButtonTextstringOptionalSubmit button text (default: "Continue")
emailLoginTextstringOptionalText for email login link (default: "Login with Email")
signUpTextstringOptionalSign up link text (default: "Don't have an account? Sign up")
rightImageUrlstringOptionalAlternative prop name for posterUrl
backgroundColorstringOptionalCustom background color (overrides theme)
childrenReact.ReactNodeOptionalAdditional content to render

✨ Features

📱 Phone Input

Country code selector with phone number input

✅ Consent Checkbox

Optional OTP consent checkbox for verification

📧 Email Login Alternative

Quick switch to email login

🔙 Back Navigation

Optional back button with callback

🎨 Customizable Branding

Logo, title, subtitle, and right poster image

🌓 Dark Mode

Automatic theme support

🔗 Link Integration

Email login and sign up links

⚡ Loading States

Built-in loading and error handling

📱 Responsive

Mobile-first responsive design

🎯 Theme Colors

Integrates with dynamic theme colors