Reference Field Reference
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() (checkbox) but rendered as a sliding toggle. Never localizable — a flag is a flag in any language.
Example
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 — the same editor, documented from the Strife Studio UI side.
fields.switch()— same output shape, rendered as a checkbox instead of a sliding toggle.