UX.SOL

Component

Wallet Connect Button

Connects a Solana wallet and displays the current connection state.

Preview

Installation

terminal
$npx shadcn@latest add https://uxdotsol.xyz/r/connect-wallet-btn.json

Usage

usage
import { SolanaProvider } from "@/components/uxdotsol/components/solana-provider";
import { ConnectWalletBtn } from "@/components/uxdotsol/components/connect-wallet-btn";
 
export default function App() {
return (
<SolanaProvider>
<div className="flex justify-end p-4">
<ConnectWalletBtn />
</div>
</SolanaProvider>
);
}
.env.local
MAINNET_RPC=YOUR_MAINNET_RPC_URL
DEVNET_RPC=YOUR_DEVNET_RPC_URL

Props / Arguments

NameTypeDefaultDescription
menuOpenbooleanfalseCurrent open/closed state of the mobile navigation menu. Drives the hamburger ↔ close icon.
onMenuToggle(open: boolean) => voidundefinedCalled when the mobile menu toggle is pressed. Receives the new boolean state.
classNamestring''Optional Tailwind / CSS class applied to the outermost flex wrapper.
showMenuTogglebooleantrueControls whether the mobile navigation toggle is rendered beside the wallet control.