Skip to main content
Use this hook when you need to control the login modal programmatically. It’s useful for protected actions that require authentication, like adding items to a wishlist or accessing account-specific features.

Import

Return Value

PropertyTypeDescription
openLogin(options?: OpenLoginOptions) => voidOpens the login modal with optional configuration
closeLogin() => voidCloses the login modal

OpenLoginOptions

PropertyTypeDefaultDescription
isRequiredbooleanfalseWhen true, prevents the modal from being closed by clicking the backdrop
titlestringnullCustom title to display in the login modal header

Usage

Example

A favorites button that prompts the user to log in before adding an item to their wishlist.