DEV Community

Discussion on: Should a button communicate the current state, the intended behavior, or both?

Collapse
 
jeyj0 profile image
Jannis Jorre

I definitely think buttons should indicate expected behavior, not state. I think we can apply the single-responsibility principle here! While it is usually not used for UI/UX, it was invented to make code easier to understand for humans. So I think it works just as well for UI/UX.
Therefore I think buttons should say "Save"/"Unsave", "Follow"/"Unfollow",... It is possible to add another item to the UI indicating state: "You are following USER123"/"You are not following USER123." Be careful though to make these really clear.

I think of buttons as function invocations, or requests for action. Something else can then tell me the result.

There might be good exceptions though - as there always are.

Collapse
 
jeyj0 profile image
Jannis Jorre

Oh, also: I don't think hover effects are enough. If someone is using a touchscreen they don't work, and to others it might not be obvious. When using a keyboard instead of mouse they also don't work. Rather have two different UI elements.