A toggle is a switch that lets you move between two states, like on and off. Toggles are used in all sorts of software from browsers to video games and are the default option for settings that don’t have a default value.
The word “toggle” dates to the 18th century, where it originally meant a pin that’s passed through the eye of a rope or chain to fasten it. It’s also used figuratively to refer to any kind of up-and-down command such as turning the caps lock on or off.
Feature toggles are a great way to control the activation of features for a small segment of users (or all users). They’re especially good for features that have a complex interaction or have a significant impact on user experience, such as changing font size, color or contrast. Toggles can be hard to get right, so it’s important to test them with your target audience to ensure that they perform as intended.
In our testing, toggles that use a more pronounced difference in visual cues between the active and inactive state perform worse than those that don’t. This may be because they require more cognitive effort to perceive which side of the toggle is the current state and whether that state is good or bad.
Another challenge is ensuring that the toggle configuration can be changed quickly and easily, ideally without any code changes to the app. This can be done with commenting, but this is a relatively manual approach and isn’t suitable for situations where the toggle configuration needs to be re-configured frequently, such as for Feature Toggles.