What is a Toggle?


Toggle is a hardware or software switch that has two positions, ON and OFF. For example, a toggle button on a keyboard turns the caps lock or num lock functions ON and OFF. In software, the word is often used as a shorthand for setting system configuration options, such as “Airplane Mode ON” or “Airplane Mode OFF”. This is the preferred approach to system settings in mobile applications because it takes less screen estate than two radio buttons and it allows users to change a feature without needing to click a Save or Confirm button.

Toggles are also a great way to perform A/B testing or multivariate experiments. When a user is added to a cohort they are consistently sent down one codepath or another, and aggregate data on the effectiveness of each is collected. This can help inform product decisions on things like the purchase flow in an ecommerce site or Call To Action wording on a button.

In addition to testing the toggle configuration which is expected to go live in production savvy teams test their “fallback” configuration as well. This is the default configuration where existing or legacy behavior is enabled when the toggle is flipped ON and new or future behaviour is disabled when it is flipped OFF.

For toggles which are highly dynamic in nature, a more sophisticated solution is required. For example, when a toggle is configured to limit access to a feature for premium users and is re-configured every time a new release is deployed then it makes more sense to use some type of distributed config management system rather than hardcoding the toggle configuration into each deployment.