Skip to main content

Interface: AccountIconAndMenuProps

Defined in: components/AccountIconAndMenu.tsx:25

Properties

accountHeaderLoginForm?

optional accountHeaderLoginForm?: boolean

Defined in: components/AccountIconAndMenu.tsx:55

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

Default

true

accountMenuTitle?

optional accountMenuTitle?: string

Defined in: components/AccountIconAndMenu.tsx:49

Title for the account dropdown menu.

Default

'My account'

afterLogin?

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

Defined in: components/AccountIconAndMenu.tsx:114

Callback fired after successful self-contained login. Not called in delegation mode — the parent handles the result there.

Parameters

user

Contact | Customer

accessToken?

string

refreshToken?

string

expiresAt?

string

anonymousCart?

Cart | null

Returns

void


beforeLogin?

optional beforeLogin?: () => void

Defined in: components/AccountIconAndMenu.tsx:108

Callback fired before the login process starts.

Returns

void


cart?

optional cart?: Cart | null

Defined in: components/AccountIconAndMenu.tsx:123

Anonymous cart snapshot — forwarded to the embedded LoginForm so its afterLogin receives it.


currentPath?

optional currentPath?: string

Defined in: components/AccountIconAndMenu.tsx:198

Current route path, used in sidebar variant to highlight the active link.


optional displayForgotPasswordLink?: boolean

Defined in: components/AccountIconAndMenu.tsx:84

Show/hide the forgot password link inside the login form.

Default

true

optional displayGuestCheckoutLink?: boolean

Defined in: components/AccountIconAndMenu.tsx:96

Show/hide the guest checkout link inside the login form.

Default

false

optional displayRegisterLink?: boolean

Defined in: components/AccountIconAndMenu.tsx:90

Show/hide the register link inside the login form.

Default

true

graphqlClient?

optional graphqlClient?: GraphQLClient

Defined in: components/AccountIconAndMenu.tsx:63

GraphQL client for self-contained login. When provided (and onLoginSubmit is not), LoginForm handles authentication internally.


icon?

optional icon?: string

Defined in: components/AccountIconAndMenu.tsx:36

Icon for the account icon in header.

Default

'default-account-icon'

iconClassName?

optional iconClassName?: string

Defined in: components/AccountIconAndMenu.tsx:183

Additional class name for the account icon button.


labels?

optional labels?: Record<string, string>

Defined in: components/AccountIconAndMenu.tsx:174

Labels for the component. Available keys: accountLabel, loginTitle, loginSubtitle, loginButton, signedInAs, logoutLabel.


loginButtonText?

optional loginButtonText?: string

Defined in: components/AccountIconAndMenu.tsx:78

Label for the login submit button.

Default

'Log In'

loginError?

optional loginError?: string

Defined in: components/AccountIconAndMenu.tsx:105

Error message shown inside the login form. Used in delegation mode (when onLoginSubmit is provided).


loginFormComponent?

optional loginFormComponent?: ComponentType<LoginFormProps>

Defined in: components/AccountIconAndMenu.tsx:203


loginFormLabels?

optional loginFormLabels?: Record<string, string>

Defined in: components/AccountIconAndMenu.tsx:180

Translated labels forwarded to the embedded <LoginForm> shown in the dropdown when no user is signed in. See LoginFormProps.labels for slugs (email, password, forgotPassword, registerText, registerLink, noAccount, loggingIn, etc.).


loginFormSubtitle?

optional loginFormSubtitle?: string

Defined in: components/AccountIconAndMenu.tsx:72

Subtitle displayed inside the login form.


loginFormTitle?

optional loginFormTitle?: string

Defined in: components/AccountIconAndMenu.tsx:69

Title displayed inside the login form.

Default

'Welcome Back'

loginLoading?

optional loginLoading?: boolean

Defined in: components/AccountIconAndMenu.tsx:162

Whether login is currently in progress (shows loading state on button).

Default

false

optional menuClassName?: string

Defined in: components/AccountIconAndMenu.tsx:186

Additional class name for the dropdown menu.


optional menuLinks?: AccountMenuLink[]

Defined in: components/AccountIconAndMenu.tsx:168

Account navigation links shown when user is authenticated.

Default

[{ label: 'Dashboard', href: '/account' }, ...]

onAccountIconClick?

optional onAccountIconClick?: () => void

Defined in: components/AccountIconAndMenu.tsx:136

Fires when account icon is clicked and showAccountMenuOnClick is false.

Returns

void


onForgotPasswordClick?

optional onForgotPasswordClick?: () => void

Defined in: components/AccountIconAndMenu.tsx:151

Fires when "Forgot Password" link is clicked.

Returns

void


onGuestCheckoutClick?

optional onGuestCheckoutClick?: () => void

Defined in: components/AccountIconAndMenu.tsx:99

Fires when the guest checkout link is clicked.

Returns

void


onLoginSubmit?

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

Defined in: components/AccountIconAndMenu.tsx:131

Fires when login form is submitted (delegation mode). Parent should handle actual authentication.

Parameters

email

string

password

string

Returns

void


onLogoutClick?

optional onLogoutClick?: () => void

Defined in: components/AccountIconAndMenu.tsx:146

Fires when logout is clicked.

Returns

void


onMenuItemClick?

optional onMenuItemClick?: (href) => void

Defined in: components/AccountIconAndMenu.tsx:141

Fires when a menu item is clicked. Receives the href.

Parameters

href

string

Returns

void


onRegisterClick?

optional onRegisterClick?: () => void

Defined in: components/AccountIconAndMenu.tsx:156

Fires when "Register" link is clicked.

Returns

void


showAccountMenuOnClick?

optional showAccountMenuOnClick?: boolean

Defined in: components/AccountIconAndMenu.tsx:43

Show account dropdown at the bottom of the icon when account icon is clicked. If false, fires onAccountIconClick() instead.

Default

true

user?

optional user?: Contact | Customer | null

Defined in: components/AccountIconAndMenu.tsx:30

Contact/Customer that this component will operate with. When present, shows account navigation. When null, shows login form.


variant?

optional variant?: "dropdown" | "sidebar"

Defined in: components/AccountIconAndMenu.tsx:193

Component variant.

  • 'dropdown' (default): Header icon with popup menu
  • 'sidebar': Always-visible vertical navigation for account layout