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

# fields.switch()

Boolean checkbox toggle. Never localizable.

Boolean toggle. Maps to editor `{ name: 'str-switch', type: 'checkbox' }`. Switches are never localizable — a flag is a flag in any language.

> [!NOTE]
> `switch` is a JavaScript reserved word, so the implementation is internally named `switchField` and re-exported as `fields.switch`. You'll only ever call it as `fields.switch(...)` — the internal name only shows up if you're reading the `@strifeapp/schema` source itself.

## Example

```ts
fields.switch({
  label: 'Featured',
})
```

## 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

* [Checkbox](https://strife.app/docs/reference/fields/checkbox.md) — the same editor, documented from the Strife Studio UI side.
* [`fields.toggle()`](https://strife.app/docs/reference/field-reference/fields.toggle.md): same output shape and the same Yes/No choice in Studio.
