ConnectButton
Using and customising the ConnectButton
This is the main component. It is responsible for rendering the connect/disconnect button, as well as chain-swapping UI.
The ConnectButton
component exposes several props to customize its appearance, including toggling the visibility of different elements.
Prop | Type | Default |
---|---|---|
label | string | Connect Wallet |
accountStatus | enum | full |
chainStatus | enum | { smallScreen: "icon", largeScreen: "full" } |
showBalance | enum | { smallScreen: false, largeScreen: true } |
Use the label
prop to set a custom ConnectButton
text.
Here are a few different ways you can use the accountStatus
prop.
Only show the account's avatar.
Only show the account's address.
Here are a few different ways you can use the chainStatus
prop.
Only show the current chain's icon.
Only show the current chain's name.
Hide the chain UI entirely.
Use the showBalance
prop to hide/show the balance.
Hide the balance.
These props can also be defined in a responsive format.
On small screens, only show account icon. But on large screens, show icon and address.
On small screens, hide balance. But on large screens, show it.