# Feature Switch

Use the FeatureSwitch to give users control over a settings-level feature. The
FeatureSwitch should tell the user what the feature is, allow them to turn it on
and off, and optionally allow them to edit any options applicable to the
feature.

## Design & usage guidelines

The FeatureSwitch is intended to be used in settings for features that apply to
a system-wide experience. An example of this might be automated messaging
settings, where the user needs to both decide whether or not to use a type of
message, what the message template might be, and when the message should be
sent.

If the user is making a per-use-case on/off decision, such as enabling automatic
payments for a single invoice, use the [Switch](../Switch/Switch.md) component.


## Props

### Web

| Prop | Type | Required | Default | Description |
|------|------|----------|---------|-------------|
| `description` | `string` | No | — | Feature description. This supports basic markdown node types such as `_italic_`, `**bold**`, and `[link name](url)` |
| `disabled` | `boolean` | No | `false` | Determines if the switch is disabled |
| `enabled` | `boolean` | No | `false` | Defines if the feature should be ON or OFF by default. |
| `externalLink` | `boolean` | No | `false` | Defines if the links in the description should open in a new tab. |
| `hasSaveIndicator` | `boolean` | No | `false` | Determines if a save indicator should show up when the `enabled` prop changes. This means, it would only work for con... |
| `onEdit` | `() => void` | No | — | Callback when clicking with the edit button. This also determines if the edit button should show up in the UI. |
| `onSwitch` | `(newValue: boolean) => void` | No | — | Callback when interacting with the switch. @param newValue |
| `title` | `string` | No | — | Feature title. |
