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

# fields.toggle()

Boolean sliding-toggle switch. Never localizable.

Boolean toggle-switch. Maps to editor `{ name: 'str-switch', type: 'toggle' }` — the same component name as [`fields.switch()`](https://strife.app/docs/reference/field-reference/fields.switch.md) (`checkbox`) but rendered as a sliding toggle. Never localizable — a flag is a flag in any language.

## Example

```ts
fields.toggle({
  label: 'Enable comments',
})
```

## Options

| Option         | Type      | Required | Description                                                |
| -------------- | --------- | -------- | ---------------------------------------------------------- |
| `label`        | `string`  | Yes      | Label shown to editors in Strife Studio.                   |
| `description`  | `string`  | No       | Tooltip shown to editors.                                  |
| `searchable`   | `boolean` | No       | Include in the team's search index.                        |
| `filterable`   | `boolean` | No       | Allow filtering content lists by this value.               |
| `protected`    | `boolean` | No       | Restrict editing to users with the appropriate permission. |
| `propertyName` | `string`  | No       | Override the stored property name.                         |

No `localizable` option — booleans can't be localized.

## Output type

`boolean`.

## See also

* [Toggle](https://strife.app/docs/reference/fields/toggle.md) — the same editor, documented from the Strife Studio UI side.
* [`fields.switch()`](https://strife.app/docs/reference/field-reference/fields.switch.md) — same output shape, rendered as a checkbox instead of a sliding toggle.
