> 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`), and Studio shows both the same way, as a Yes/No choice. 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.                   |
| `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 and the same Yes/No choice in Studio.
