Library/LogIn

LogIn

Unified auth card that toggles between login & register modes with animated transitions and a switch link.

Modular Build
Interactive Preview
Initialising Operative...

Architecture

Component Architecture
LogIn/

Prop Usage

PropTypeDefaultDescription
defaultMode
"login" | "register""login"Which form is shown initially.
registrationMode
"otp" | "confirmation-link""otp"Post-registration flow: advance to OTP entry or show "check inbox" screen.
loading
booleanfalseExternal loading flag that disables the form.
onLoginSubmit
(values: { email; password }) => voidCalled on password login form submit.
onRegisterSubmit
(values: { name; email; password }) => voidCalled on registration form submit.
onGoogleSignIn
() => voidShows and handles Google OAuth login.
onGoogleSignUp
() => voidShows and handles Google OAuth sign-up.
onSendOtp
(email: string) => voidCalled to send a 6-digit OTP to the given email.
onVerifyOtp
(email: string, token: string) => voidCalled to verify the OTP token.
extraFields
React.ReactNodeSlot for injecting additional content (e.g. error messages) inside the form.

Usage

import { LogIn } from '@/ui/features/LogIn'; <LogIn registrationMode="otp" onLoginSubmit={async ({ email, password }) => { await supabase.auth.signInWithPassword({ email, password }); }} onRegisterSubmit={async ({ name, email, password }) => { await supabase.auth.signUp({ email, password, options: { data: { full_name: name } } }); }} onSendOtp={async (email) => { await supabase.auth.signInWithOtp({ email }); }} onVerifyOtp={async (email, token) => { await supabase.auth.verifyOtp({ email, token, type: 'signup' }); }} />