Modal & Connection Management
Modal control
useTrustModal
import { useTrustModal } from '@trustwallet/connect-react'
function ConnectButton() {
const { open } = useTrustModal()
return (
<>
{/* Open wallet selection */}
<button onClick={() => open()}>Connect Wallet</button>
{/* Prompt the user to connect to a specific namespace */}
<button onClick={() => open({ type: 'namespace', namespaceId: 'eip155' })}>
Connect EVM Wallet
</button>
</>
)
}Parameter
Type
Description
Connection state
useConnections
useConnection
Property
Type
Description
Last updated
Was this helpful?