Toggle is a user interface component that helps people manage the state of settings, views, or content. Generally, toggles help people choose between two opposing values by using a different appearance for each state and by clearly identifying the setting or view that’s being managed. If you want to support other types of actions, such as choosing from a list of items, use another component, like a button.
Toggles are useful for experiments or features that are rolled out over time to collect feedback from users. They enable teams to compare the status quo to an alternative and make informed decisions about whether a change is good or bad for the product. Toggles encourage teams to push their boundaries in experimentation and give them the flexibility to learn and adapt. They also help teams shift the culture of the organization to embrace and celebrate experimentation instead of shying away from it.
Many teams manage the configuration of their toggles through some type of centralized repository. This can be as simple as a set of static files or as complicated as an existing application DB or database. The more sophisticated approaches can even provide runtime re-configuration of the toggle’s state. Depending on the complexity and scale of your toggles, the configuration management approach you choose will have an impact on your cycle time for testing and deploying new changes. A more sophisticated approach will also increase the complexity of your CI/CD pipeline.