Depends on the context. If you hide the button the user may feel confused and lost but would remove unnecessary elements from the screen, if you disable the button the user is aware of possible actions and maintains control of the user.
- Is it better to disable a button or hide it?
- Why you shouldn't use disabled buttons?
- Should you use disabled buttons?
- Why you shouldn t include disabled interaction elements in your design system?
Is it better to disable a button or hide it?
Buttons. Disable the control to indicate that the user needs to do something first to “unlock” the functionality that this button performs. Buttons should never be hidden, because there is an expectation of persistence for them.
Why you shouldn't use disabled buttons?
Bad accessibility
Grey buttons with gray labels can easily fail to meet color contrast recommendations for text. Sometimes disabled buttons are designed in a way that they cannot be read by a screen reader (buttons are not focusable, and hence users can't reach them with a keyboard).
Should you use disabled buttons?
While designing the UI, avoid using a disabled button as it becomes hard to find out why it is disabled and what should be done to make it enable. It is better to keep buttons enabled all the time and highlight the field if users don't provide the required information.
Why you shouldn t include disabled interaction elements in your design system?
Disabled options only communicate implicitly. At best they are ambiguous; at worst, impenetrable. If you show an element but don't allow people to interact with it, they then have to interpret why they can't.