Skip to main content

Interface: LoginFormProps

Defined in: components/LoginForm.tsx:23

Properties

accountHeaderLoginForm?

optional accountHeaderLoginForm?: boolean

Defined in: components/LoginForm.tsx:125

Show login form in dropdown for immediate login when user is not logged in.

Default

true

afterLogin?

optional afterLogin?: (user, accessToken?, refreshToken?, expiresAt?, anonymousCart?) => void

Defined in: components/LoginForm.tsx:110

Callback after successful login with user data. anonymousCart is the cart held in the parent's state at the moment of submission, forwarded so the parent can merge it into the authenticated user's cart.

Parameters

user

Contact | Customer

accessToken?

string

refreshToken?

string

expiresAt?

string

anonymousCart?

Cart | null

Returns

void


beforeLogin?

optional beforeLogin?: () => void

Defined in: components/LoginForm.tsx:104

Callback before the login process starts

Returns

void


buttonText?

optional buttonText?: string

Defined in: components/LoginForm.tsx:68

Label for the submit button

Default

"Login"

cart?

optional cart?: Cart | null

Defined in: components/LoginForm.tsx:119

Anonymous cart snapshot from the parent's state — forwarded to afterLogin.


children?

optional children?: ReactNode

Defined in: components/LoginForm.tsx:136

Compound mode opt-in. When provided, LoginForm renders the compound subtree (using <LoginForm.X> subcomponents) instead of the default layout. Subcomponents share form state via context.


configuration?

optional configuration?: object

Defined in: components/LoginForm.tsx:128

Config object providing imageSearchFiltersGrid and imageVariantFiltersSmall.

imageSearchFiltersGrid?

optional imageSearchFiltersGrid?: MediaImageProductSearchInput

imageVariantFiltersSmall?

optional imageVariantFiltersSmall?: TransformationsInput


optional displayForgotPasswordLink?: boolean

Defined in: components/LoginForm.tsx:44

Show/hide the password reset link

Default

true

optional displayGuestCheckoutLink?: boolean

Defined in: components/LoginForm.tsx:60

Show/hide the guest checkout link

Default

true

optional displayRegisterLink?: boolean

Defined in: components/LoginForm.tsx:52

Show/hide the registration link

Default

true

graphqlClient?

optional graphqlClient?: GraphQLClient

Defined in: components/LoginForm.tsx:29

GraphQL client for self-contained login. When provided (and onLoginSubmit is not), the component handles authentication internally via LoginService + UserService.


labels?

optional labels?: Record<string, string>

Defined in: components/LoginForm.tsx:83

Labels for the login form fields.

Available keys:

  • email: Email field label (default: "Email")
  • password: Password field label (default: "Password")
  • emailPlaceholder: Email input placeholder (default: "name@example.com")
  • passwordPlaceholder: Password input placeholder (default: "••••••••")
  • forgotPassword: Forgot password link text (default: "Forgot password?")
  • registerText: Text before register link (default: "Don't have an account?")
  • registerLink: Register link text (default: "Create an Account")
  • guestCheckoutLink: Guest checkout link text (default: "Continue as Guest")

loginError?

optional loginError?: string

Defined in: components/LoginForm.tsx:101

Error message to display in the form. Used in delegation mode. In self-contained mode the component manages its own error.


loginLoading?

optional loginLoading?: boolean

Defined in: components/LoginForm.tsx:96

Whether login is currently in progress (shows loading state on button). Used in delegation mode. Ignored in self-contained mode.

Default

false

onForgotPasswordClick?

optional onForgotPasswordClick?: (event?) => void

Defined in: components/LoginForm.tsx:47

Action for the password reset link click

Parameters

event?

MouseEvent<Element, MouseEvent>

Returns

void


onGuestCheckoutClick?

optional onGuestCheckoutClick?: (event?) => void

Defined in: components/LoginForm.tsx:63

Action for the guest checkout link click

Parameters

event?

MouseEvent<Element, MouseEvent>

Returns

void


onLoginSubmit?

optional onLoginSubmit?: (email, password) => void

Defined in: components/LoginForm.tsx:90

Fires when login form is submitted (delegation mode). When provided, the component does NOT call the SDK — the parent handles authentication. When absent and graphqlClient is provided, the component handles login internally.

Parameters

email

string

password

string

Returns

void


onRegisterClick?

optional onRegisterClick?: (event?) => void

Defined in: components/LoginForm.tsx:55

Action for the registration link click

Parameters

event?

MouseEvent<Element, MouseEvent>

Returns

void


subtitle?

optional subtitle?: string

Defined in: components/LoginForm.tsx:39

Subtitle of the login form

Default

""

title?

optional title?: string

Defined in: components/LoginForm.tsx:34

Title of the login form

Default

"Log in"