difference between toggle button and switch

大城市里の小女人 提交于 2019-12-12 18:53:48

问题


What is the difference between a toggle button and switch? As they provide same feature, what is the specific use case to use a toggle button or a switch?

Toggle button:

Switch:


回答1:


This is more of a User Experience question than just Coding. Here is my answer:

The description of the control says it:

Toggle is a button : sap.m.ToggleButton

whereas

switch is a user input. sap.m.Switch

However, the main difference lies in the User Experience and usage.

Here is what the Fiori Guideline says: When to use Switch

  • You need to emphasize the On/Off characteristic within a dialog.
  • You need to clearly show the mode or state that a setting is in.
  • You need a toggle switch for binary settings when changes become effective immediately after the user changes them. For example, if the user needs to set data transmission or accept/reject business objects.

vs

Behavior of Buttons

To summarize, I can say: Switch primarily represents a state(a physical state like a fan "On' or "Off") and the text should not be too big.

whereas, a button is an action mostly a verb which user performs and this can be a longer text like "Activate

You can read a little more on the difference based on UX with an example: Difference between switch and toggle



来源:https://stackoverflow.com/questions/50525778/difference-between-toggle-button-and-switch

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!