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 | Not shown in Studio's editor panel. |
searchable | boolean | No | Stored on the template; nothing uses it today. |
filterable | boolean | No | Stored on the template; nothing uses it today. |
protected | boolean | No | Stops the field from being edited or removed in Studio's template designer. No effect in the editor panel. |
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.