DEV Community

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

Collapse
 
lexlohr profile image
Alex Lohr

What we have here is a blend of different paradigms: button and checkbox. In the cases you mentioned here, the button is actually not representing a singular action, but instead a dual-state or in case of the zoom a multi-state switch.

The ideal solution would be a component that conveys both its present state and its future state in an understandable way. In case of the follow-button, this would probably be something like a Checkbox button

[✓] FOLLOWING

[   ] FOLLOWING

The checkbox conveys that this element has a state that could be toggled rather than singularly selected.

Collapse
 
joshuakaden profile image
Joshua Kaden

There's a tension between screen real-estate and clarity of function. The "state button" takes up less space than the switch or checkbox, but it can be unclear what the current state is, because of the blending of paradigms that you mention.