What is a Toggle Control?

February 14, 2024 by No Comments

Toggle is a control that lets users update settings, views or other types of information. When designing toggles, it’s important to be consistent in the way they appear and use clear, direct labels. This helps prevent confusion and maintain consistency with the rest of the interface.

Toggles can be used to test a range of different configurations of features before they become live in production. They are a useful tool for teams who want to verify that existing or legacy behavior is enabled when a toggle is flipped Off and that new or future behaviour is enabled when a toggle is flipped On. Many teams also test their production environment with a toggle configured the same way that they expect it to be live in production so they can spot regressions early and roll out fixes quickly.

Generally speaking Release Toggles should only be around for a week or two (although product-centric toggles may be in place much longer) before they are removed once it is determined that the feature is stable. Toggle configuration living side by-side in source code can also help reduce the number of if-else statements in the codebase by eliminating the need to manually redeploy the artifacts to re-configure them (or worse still re-deploy the entire service into a shared test environment).

Toggles can also be used for things like Experiment Toggles or other multivariate or A/B testing where a toggle router will consistently send a specific cohort down one codepath over another. These tend to be more long-lived than a release toggle and often need to be re-configured on a per-request basis.