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/solana-provider";
import { ConnectWalletBtn } from "@/components/connect-wallet-btn";
 
export default function App() {
return (
<SolanaProvider>
<div className="flex justify-end p-4">
<ConnectWalletBtn />
</div>
</SolanaProvider>
);
}
.env.local
MAINNET_RPC=https://mainnet.helius-rpc.com/?api-key=your_key
DEVNET_RPC=https://devnet.helius-rpc.com/?api-key=your_key

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.