UI component for logging in with Treasure Connect and viewing and managing active account status.

Usage

import { ConnectButton } from "@treasure-dev/tdk-react";

function App() {
  return (
    <ConnectButton />
  );
}

Props

connectModalSize

"lg" | "xl" | "2xl" | "3xl" | undefined

  • Controls the maximum width of the connect modal. See Tailwind CSS docs for rem and pixel values.
  • Defaults to "lg".

disablePasskey

boolean | undefined

  • Disables the passkey login option in the connect modal.
  • Defaults to false.

disableWallet

boolean | undefined

  • Disables the Web3 wallet login option in the connect modal.
  • Defaults to false.

supportedChainIds

number[] | undefined

  • List of chain IDs that are supported by the app to show in chain switcher in the connected account modal.

authMode

"popup" | "redirect" | undefined

  • Determines the authentication mode for SSO login options in the connect modal.
  • Defaults to "popup".

redirectUrl

string | undefined

  • Optional URL to redirect to after SSO login.

hideDisconnect

boolean | undefined

  • Hides the disconnect button in the account modal.
  • Defaults to false.