NetworkSelectorProps
type NetworkSelectorProps = { onCustomClick?: () => void; popularChainIds?: Array<number>; recentChainIds?: Array<number>; renderChain?: React.FC<NetworkSelectorChainProps>; sections?: Array<ChainSection>;};
Deprecated
Use sections
prop instead
If sections
prop is provided, this prop will be ignored
Chains to be displayed as "Popular"
type popularChainIds = Array<number>;
Deprecated
Use sections
prop instead
If sections
prop is provided, this prop will be ignored
Chains to be displayed as "Recent"
type recentChainIds = Array<number>;
Override how the chain button is rendered in the Modal
type renderChain = React.FC<NetworkSelectorChainProps>;
Specify sections of chains to be displayed in the Network Selector Modal
type sections = Array<ChainSection>;
To display "Polygon", "Avalanche" chains under "Recently used" section and "Ethereum", "Arbitrum" chains under "Popular" section, you can set the prop with the following value
import { arbitrum, base, ethereum, polygon } from "thirdweb/chains"; const sections = [ { label: "Recently used", chains: [arbitrum, polygon] }, { label: "Popular", chains: [base, ethereum] },];