Daily Archives: June 8, 2023

Leveraging Toggle at Scale

Toggle is a simple but powerful user interface element. When used properly it allows users to quickly update preferences, settings and other types of information. When designing toggles it is important to think about the context they will be used in and how their visual design can impact user experience. For example, it is often good practice to use high-contrast colors for toggles to provide clear visibility of the current state (On/Off). Additionally, when utilizing color in toggles be sure to evaluate societal and cultural implications as well.

The word toggle derives from the verb to switch between one state and another, like when you toggle the screen on your video chat so that both people can see each other. This same idea applies to software: a toggle is a switch that can be flipped on or off, enabling or disabling functionality.

Toggles are very useful at the front-end when building new features and it is common for them to be used in place of more complex or lengthy options menus. In fact, most software applications have some form of toggle configuration. However, leveraging them at scale can be challenging. This is because using static files to manage toggle configuration becomes cumbersome as the system grows. Additionally, changing the configuration through these methods can be fiddly and introduces additional steps into the CI/CD process which can significantly affect how quickly changes can be made and the overall efficiency of the QA/testing environment.

At a more operational level savvy teams will look at their Feature Toggles as inventory that comes with a carrying cost and seek to keep this inventory low by being proactive about removing toggles that are no longer required. Many teams even go so far as to put a task on their backlog or create an Expire Date for toggles to ensure they are removed in a timely manner.

A more long-lived category of Feature Toggle is the Permissioning Toggle which is used to make data-driven decisions around whether or not to expose a feature to a cohort of users at runtime. As this type of Toggle is very user-specific it may live at the toggle configuration level for multiple years before it needs to be re-evaluated.

Regardless of which Feature Toggle category is being used it is always wise to test the final toggle configuration that will be in production, as well as the default fallback toggle which will be flipped Off. Additionally, some teams will also perform tests with all of the toggles flipped On to ensure that any changes they make don’t cause unexpected regressions.