Skip to content

[bug]: Button does not have cursor-pointer by default #7223

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
2 tasks done
cheekEprogrammer opened this issue Apr 18, 2025 · 8 comments
Open
2 tasks done

[bug]: Button does not have cursor-pointer by default #7223

cheekEprogrammer opened this issue Apr 18, 2025 · 8 comments
Labels
bug Something isn't working

Comments

@cheekEprogrammer
Copy link

Describe the bug

The Button component does not show a cursor when hovered over by default. Whenever I make a new project now I need to add it in manually. Can this just be put in as a default?

Affected component/components

Button

How to reproduce

  • Make a Hello World button.
  • Hover over the button and the cursor does not change.

Codesandbox/StackBlitz link

No response

Logs

System Info

All

Before submitting

  • I've made research efforts and searched the documentation
  • I've searched for existing issues
@cheekEprogrammer cheekEprogrammer added the bug Something isn't working label Apr 18, 2025
@yhoungdev
Copy link

I have been noticing this too, but I always fix it locally.

Is there a chance if I could work on this ?

@cheekEprogrammer
Copy link
Author

I have been fixing it locally also each time I start a new project. I would assume its just a matter of adding "cursor-pointer" or something to the default button props. I will admit im not a github expert yet so I did not want to screw anything up with the PR process :)

@yhoungdev
Copy link

Yea, just add cursor-pointer to the default state of your ui/button.

@gungdekrisna
Copy link

I think this behavior is related to the Tailwind v4 update, where they changed the default cursor style for buttons.

According to the Tailwind v4 Upgrade Guide:

“Buttons now use cursor: default instead of cursor: pointer to match the default browser behavior.”

So in Tailwind v4, buttons no longer automatically show the hand cursor unless you explicitly add cursor-pointer.

I think it's better to create a custom wrapper button component that extends the default Button and includes the additional styling. That way, if you ever need the original style (without cursor-pointer), you can still use the default Button component.

@yhoungdev
Copy link

I think this behavior is related to the Tailwind v4 update, where they changed the default cursor style for buttons.

According to the Tailwind v4 Upgrade Guide:

“Buttons now use cursor: default instead of cursor: pointer to match the default browser behavior.”

So in Tailwind v4, buttons no longer automatically show the hand cursor unless you explicitly add cursor-pointer.

I think it's better to create a custom wrapper button component that extends the default Button and includes the additional styling. That way, if you ever need the original style (without cursor-pointer), you can still use the default Button component.

Yes, your approach is good too, but the default state of button has not been like that on @shadcn since tailwind v3

@bernaferrari
Copy link
Contributor

Duplicate of #6843. I agree it is bad and I hope shadcn/ui fixes this.

@VikasN37
Copy link

Tried fixing the issue by applying the cursor-pointer style to the Button component's base. Tested and confirmed working on my local system.

@yhoungdev
Copy link

Yea, that is how it was supposed to be

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants