feat:Allow passing classname prop to connect button #2482
jingjiezhou2021
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I’m currently using the
ConnectButton
component, and I’ve noticed that it doesn’t support passing aclassName
prop. This makes it a bit difficult to customize styling using utility-based frameworks like Tailwind CSS.#1465 I also see this discussion where people complaining the same lack of support for missing an approach to provide custom css class and end up using a hack approach
#1117 And this one
I am aware of using a customized
ConnectButton.custom
and implementing render function from scratch is one way to apply custom styling, but in my opinion letting the user to reimplement of the build in button only to change the style might cause inconsistency with the lib and it's complicated. Maybe a user just wanna change the backgroud color of the button and now he has to rewrite the whole button.I found in source code that
ConnectButton
component has two main states:Connected: shows wallet/account/chain info
Unconnected: shows a "Connect Wallet" button
🔧Suggested Change:
Add a
className
prop toConnectButton
and apply it to the outer<Box as="button" />
element only in the unconnected state. This allows consumers to pass custom class names without affecting the layout or behavior of the connected state UI.✅Result:
Passing
className
toConnectButton
won't trigger type error:The
className
is applied to theConnectButton
and taking effect:Beta Was this translation helpful? Give feedback.
All reactions