Use @web3modal/ethereum with WalletConnect and EIP-6963 support. It allows you to detect and choose between multiple injected wallets like MetaMask and Trust Wallet.
Here’s the short approach:
Use WalletConnect v2 (via Web3Modal or wagmi/connectkit).
Detect wallets using EIP-6963 (allows listing all injected providers).
Assign wallet-specific connection buttons using their provider info.
Libraries like Web3Modal v3 or Wagmi + viem support this well in Next.js.
Try Web3Modal for a simple setup that works with multiple wallets and is React/Next.js friendly.