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.
Props
The ConnectButton
component exposes several props to customize its appearance by toggling the visibility of different elements.
Prop | Type | Default |
---|---|---|
accountStatus | enum | full |
chainStatus | enum | { smallScreen: "icon", largeScreen: "full" } |
showBalance | enum | { smallScreen: false, largeScreen: true } |
Examples
Account status
Here are a few different ways you can use the accountStatus
prop.
Only show the account's avatar.
Only show the account's address.
Chain status
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.
Show balance
Use the showBalance
prop to hide/show the balance.
Hide the balance.
Responsive
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.