2

Today I had an argument with somebody about the difference between a button and a switch. The button toggles between two states (sound on/off) and changes the icon accordingly. The switch does more or less the same thing (left off/right on).

  1. Is a switch a button in UX terms? In my opinion, the only difference is, that a switch shows the current and also the alternative state while a toggle button only shows the active state (on/off).

  2. What would be a better solution for my scenario above (a game app where you can turn off and on the sound)?

https://developer.apple.com/design/human-interface-guidelines/ios/controls/switches/

2 Answers 2

3

I like to think of a switch as a type of toggle button: it's a button that can be in two states, denoting "on" and "off". It behaves pretty much exactly like a regular button.

Another way of looking at it would be seeing a switch as a type of checkbox: it is a control that can be "on" or "off" (and sometimes "none"), displaying the current state to the user.

Lately they try to separate those two, though, because they play different roles: a checkbox is being used more as a way to select something from the list, while switch - to turn something on or off.

I like this article on the topic, which pretty much summarises the difference:

A checkbox control has three states: unselected, selected, and indeterminate. The last state represents a situation where a list of sub-options is grouped under a parent option and sub-options are in both selected and unselected states.

A toggle switch represents a physical switch that allows users to turn things on or off, like a light switch.

Tapping a toggle switch is a two-step action: selection and execution, whereas checkbox is just selection of an option and its execution usually requires another control.

Moreover, Material guidelines call switches "buttons" and even are being inherited from buttons (which basically means, everything a button can do, a switch can do too). That should settle it.

Now, for your second question.

If you have to choose between using a toggle button or a switch for turning the sound on and off, you should consider if it will be clear for user what that control would do when pressed.

If there's only one control on the screen, you should probably go with the switch: it's more clear that you can turn something on and off with it. The toggle button is usually undistinguishable from a regular button and there's no way for a user to know what happens when they press it, especially if there are no other clues around - will it toggle, or, for example, open a popup?

This usually isn't that much of a problem, but something to consider nonetheless.

0

You only use a button, where as you use and change a switch's state.

Many switches masquerade as buttons, and vice-versa. This is fine, when appropriate, and a matter of design choice.

A starter button in a car, for example, is a switch masquerading as a button.

The button that closes an elevator door is a button. The buttons that select floors, on the other hand, are smart switches.

3
  • I'm not sure 'use' is the correct verb here regarding buttons. You still 'use' a switch. Your point that a switch 'changes' something is understandable, but I think you need to flesh out what a button is for in comparison.
    – JonW
    Feb 6, 2019 at 16:50
  • I looked at it long and hard, for the same reasons, and others. And came up with nothing better. You really do only use a button. Press isn't right, because it infers the button has state, which gets messy, real fast. Whereas you use and change something with a switch. I know it's baby english, but I like Orwell. Perhaps adding "only" in front of "use a button" puts it clearer. It is an interesting thought experiment. As for what a button is for... this is too broad. Buttons are the base use.
    – Confused
    Feb 6, 2019 at 22:26
  • I thought about buttons as things that issue commands, but that's not quite right, activation isn't right either. It really is just as simple (and diverse) as the fact that you "use" a button, whereas switches are finite state machines.
    – Confused
    Feb 6, 2019 at 22:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.