useAuthModal

A hook that returns the open and close functions for the Auth Modal if uiConfig is enabled on the Account Provider

Import

1import { useAuthModal } from "@account-kit/react";

Usage

1import React from "react";
2import { useAuthModal } from "@account-kit/react";
3
4const ComponentWithAuthModal = () => {
5 const { openAuthModal } = useAuthModal();
6
7 return (
8 <div>
9 <button onClick={openAuthModal}>Login</button>
10 </div>
11 );
12};

Returns

UseAuthModalResult an object containing methods for opening or closing the auth modal. ref