> From the [Strife developer docs](https://strife.app/docs/reference/fields/toggle). Every page is listed in [llms.txt](https://strife.app/docs/llms.txt).

# Toggle

The Toggle field saves a binary value of either 'true' or 'false' in the database.

<figure><img src="https://strife.app/docs/assets/Screenshot%202023-10-18%20at%2014.44.55.png" alt="" width="375"><figcaption><p>Strife Studio screenshot of a Toggle field</p></figcaption></figure>

### Settings

The Toggle field does not feature any distinctive settings beyond the standard ones.

> [!NOTE]
> You can find a comprehensive list of all basic settings in the ['Overview' section](https://strife.app/docs/reference/fields.md).

### Define with JSON

When defining templates using JSON, this field is represented using:

* **Component Name:** `str-switch`
* **Type:** `toggle`
* Reference ID: `str-switch|toggle`

The settings above map into the `editor.attributes` object inside the JSON definition.

```json
{
  ...
  "editor": {
    "name": "str-switch",
    "type": "toggle",
    "propertyName": "...",
    ...    
  },
  ...
}
```

### Live preview

> [!NOTE]
> This field does not have any default Strife Web Components. Custom live preview implementations are fully supported.

> [!NOTE]
> For more information on live preview and Strife Web Components, please refer to the [Live preview documentation](https://strife.app/docs/reference/live-preview.md).
