What Is a Toggle?

A toggle is a switch that has two positions: on or off. It is a common control for software settings such as in options menus or other configuration dialogs. A hardware toggle would be the key that turns the Caps Lock or Num Lock function on and off.

When used in the context of software, toggles are a convenient way to turn functionality on and off for the sake of testing or experimentation. Similarly, in the context of physical goods such as cordlocks, they can be used to control the tension on a drawstring or cinch down a garment. Toggle can also refer to the action of changing a setting: “I turned my phone on and then off again to see what the difference would be.”

While using toggles in general is OK, we should take into account the cognitive issues associated with them. Toggle switches don’t have an empty or neutral state and the visual signifiers are often unclear, making users guess which position the toggle is currently in (for example, using red for the on position can be confusing for people with color vision deficiency). To reduce this risk, we should avoid relying on colors to indicate the current toggle status and instead use appropriate UI elements like checkboxes and radio buttons, which clearly display their current state.

Because Release Toggles are temporary by nature it is important for teams to be proactive about removing feature flags once they are no longer needed. Some teams have a rule to add a toggle removal task to the backlog whenever a new Release Toggle is introduced, while others put “expiration dates” on their toggles so that they automatically fail a test once the flag has expired.