WalletLive Preview
Network Switcher
Clean list-based chain selector with testnet toggle, search, and per-chain loading state. Parent controls active chain.
chainnetworkswitchethereuml2
API Reference
| Prop | Type | Default | Description |
|---|---|---|---|
networks* | Network[] | — | All networks (use .testnet: true for testnets) |
activeChainId | number | — | Currently active chain ID (parent-controlled) |
onSwitch* | (chainId: number) => void | Promise<void> | — | Called when user selects a network |
searchable | boolean | false | Show search input (useful for large network lists) |
showTestnetToggle | boolean | — | Show testnet toggle (auto-detected from .testnet fields) |
switchingTo | number | — | Chain ID being switched to (shows loading spinner) |
className | string | — | Additional CSS classes |