What is a Toggle?


A toggle is a piece of rod-shaped hardware, such as an ornamental button, that can be pushed through a hole, loop, or eye to fasten it. A toggle is also a part of a machine that allows a user to switch between two functions, such as an aircraft’s com that switches between the weather channel and the air traffic control system.

A Toggle should be clearly marked as a switch, or knob, with a label that indicates what its current state is. Ideally the label is placed next to the toggle so that users can make sense of it. It is good practice to consider contrast and cultural issues when using color for toggle labels, as well as to include state descriptors.

Savvy teams view Feature Toggles as inventory which comes with a carrying cost and so try to keep their toggles to a minimum. In addition to adding a task to the backlog for every new toggle, some teams even put “expiration dates” on their toggles which will cause tests to fail (or refuse to start an application!) if a toggle is still around after its expiration date.

Most modern applications use some form of a Toggle to support multivariate or A/B testing. By assigning a cohort to a set of users and configuring the Toggle Router to consistently send them down one codepath or another, we can track the effect on specific users. This can help us identify the best course of action for things like a purchase flow or Call To Action wording.