Toggles Considered Harmful

Toggles Considered Harmful / 开关(Toggles)被视为有害

August 9, 2026 2026年8月9日

I just read this post from Marcin Wichary’s Unsung, where he points out a peculiar macOS dialog box that shows boolean toggles in four different shades of grey: 我刚刚读了 Marcin Wichary 在《Unsung》上发表的这篇文章,他指出了 macOS 中一个奇怪的对话框,其中布尔开关(boolean toggles)以四种不同的灰色阴影显示:

Marcin offers some improvements, but the actual problem is fundamental to macOS: these types of toggles are bad UI controls and should simply not exist. Marcin 提供了一些改进建议,但真正的问题在于 macOS 的根本性设计:这类开关是糟糕的 UI 控件,根本就不应该存在。

I think toggles originated on iOS, where they replaced checkboxes. I suspect the reason is that they feel more tactile on a touchscreen, have a larger touch target, and resemble physical switches - Apple’s original UI design approach for iOS valued this kind of skeuomorphism. 我认为开关起源于 iOS,当时它们取代了复选框。我怀疑原因在于它们在触摸屏上感觉更具触感,拥有更大的触摸目标,并且类似于物理开关——苹果最初的 iOS UI 设计理念非常推崇这种拟物化(skeuomorphism)风格。

Toggles make sense in the real, physical world because of their mechanical properties. But even there, they need additional affordances to work. For example, this power strip has a toggle switch to turn it on and off: 开关在现实的物理世界中是有意义的,因为它们具有机械特性。但即便如此,它们也需要额外的辅助功能才能正常工作。例如,这个电源插线板有一个用于开关电源的拨动开关:

Note that there are labels for each state, and a light to indicate the current state. That’s because the toggle itself is symmetrical. There is no obvious way to tell whether it is on or off. 请注意,每个状态都有标签,并且有一个指示灯来显示当前状态。这是因为开关本身是对称的。如果不看这些,你根本无法判断它是开启还是关闭。

Now let’s go back to the digital toggle: Is this toggle on or off? If you don’t already know that “left” means “off” and “right” means “on”, you have absolutely no way to tell. 现在让我们回到数字开关:这个开关是开启还是关闭的?如果你不知道“左”代表“关”、“右”代表“开”,你绝对无法分辨。

Apple’s attempts to make toggle states more obvious ultimately created the confusing situation in the original screenshot. Therefore, the most expedient solution to the original UI problem is simply to use a control whose state is obvious. 苹果试图让开关状态更直观的尝试,最终导致了原始截图中那种令人困惑的情况。因此,解决该 UI 问题的最快捷方案,就是直接使用状态一目了然的控件。

Update: Discussion on lobste.rs, including this point I wasn’t aware of: There is an accessibility setting on macOS named “differentiate without color”, which does help by showing little on/off indicators on the toggles. If your System Settings search field also doesn’t work, it’s under Display. Enabled. 更新:lobste.rs 上的讨论提到了我之前没注意的一点:macOS 中有一个名为“不使用颜色进行区分”(differentiate without color)的辅助功能设置,它通过在开关上显示小的“开/关”指示器来提供帮助。如果你的系统设置搜索栏也不好用,它位于“显示”设置下。已启用。

If you require a short url to link to this article, please use https://ignco.de/818 如果你需要短链接来分享这篇文章,请使用 https://ignco.de/818

But wait, there’s more! Want to read more like this? Buy my book’s second edition! Designed for Use: Create Usable Interfaces for Applications and the Web is now available DRM-free directly from The Pragmatic Programmers. Or you can get it on Amazon, where it’s also available in Chinese and Japanese. 等等,还有更多!想阅读更多类似内容吗?购买我的书的第二版吧!《Designed for Use: Create Usable Interfaces for Applications and the Web》现已在 The Pragmatic Programmers 网站上提供无 DRM 版本。或者你也可以在亚马逊上购买,该书目前也有中文版和日文版。