LazorConnect
LazorConnect Component
LazorConnect
is a plug-and-play React component that provides a UI for connecting a user's Lazor Kit wallet. It handles the wallet connection flow, displays a connect button, and calls your callback when the user connects successfully.
Usage
Props
connection
Connection
Solana connection instance (required)
onConnect
(publicKey: string) => any
Callback when wallet is successfully connected
...others
You can pass additional props for customization
useWallet Hook and connect Function
The useWallet
hook provides programmatic access to wallet features, including the connect
function for triggering the wallet connection flow from your own UI or logic. Use this when you want to build a custom wallet connect button or integrate wallet logic into your own components.
Usage
connect
connect(): Promise<void>
Opens the wallet connection popup.
Resolves when the user connects their wallet.
Updates state in the hook.
Example: Custom Connect Button
Complete Example
Last updated