Forms switch

From Legal-and-General/canopy · View interactive version

Forms switch is an AI agent skill from the GitHub repository Legal-and-General/canopy. Removal notice for the Canopy Switch selector. Trigger whenever lg-switch, switch variant usage, or related imports appear in an Angular project using Canopy.

How to use this skill

Skill file

Canopy Forms Switch - REMOVED

The lg-switch selector has been removed from Canopy's public API.

Existing switch usage should be migrated to supported components based on the interaction intent.


What to Remove

Remove switch imports/usages and selector-based switch templates:

<!-- Remove: -->
<lg-switch formControlName="notifications" value="enabled">
  Enable notifications
</lg-switch>

<!-- Remove: -->
<lg-toggle variant="switch">Enable notifications</lg-toggle>

What to Replace It With

Choose the replacement based on behaviour:

  1. Immediate on/off choice where users compare options: use lg-segment or inline radios.
  2. Selection that is reviewed and submitted later: use checkbox (lg-checkbox / LgToggleComponent).
  3. Single-choice form options from a defined set: use LgRadioGroupComponent.
<!-- Example replacement with checkbox -->
<lg-checkbox formControlName="notifications" value="enabled">
  Enable notifications
</lg-checkbox>

See also: forms-checkbox, forms-radio, forms-segment.


Don't

  1. Don't use <lg-switch> in new templates.
  2. Don't use variant="switch" on LgToggleComponent.
  3. Don't add switch-specific guidance to new design documentation.
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.