comify-login-react-native
v1.0.6
Published
A two-step phone authentication component for React Native with country code selection and OTP verification.
Readme
Comify Login React Native
A two-step phone authentication component for React Native with country code selection and OTP verification.
Installation
npm install comify-login-react-native react-native-otp-entry react-native-country-codes-pickerUsage
import { ComifyLogin } from 'comify-login-react-native';
const MyApp = () => {
const handlePhoneSubmit = (phoneNumber) => {
// Handle phone number submission
console.log('Phone number:', phoneNumber);
// Send OTP to the phone number
};
const handleOTPSubmit = (otp) => {
// Handle OTP verification
console.log('OTP:', otp);
// Verify OTP
};
return (
<ComifyLogin
onPhoneSubmit={handlePhoneSubmit}
onOTPSubmit={handleOTPSubmit}
otpLength={6} // Optional, defaults to 6
theme={{ // Optional, customize colors
primaryColor: '#007AFF',
backgroundColor: '#fff',
textColor: '#000'
}}
/>
);
};Features
- Two-step authentication flow
- Country code selection with search
- Phone number input with validation
- OTP input with customizable length
- Modern and clean UI
- Customizable theme colors
- TypeScript support
- Fully customizable styling
Props
onPhoneSubmit: Callback function when phone number is submittedonOTPSubmit: Callback function when OTP is submittedotpLength: Number of OTP digits (optional, defaults to 6)theme: Customize component colors (optional)primaryColor: Primary color for buttons and borders (default: '#007AFF')backgroundColor: Background color (default: '#fff')textColor: Text color (default: '#000')
License
MIT
