799c7e6936
Co-authored-by: Denys Konovalov <kontakt@denyskon.de> Co-authored-by: Mathieu COSYNS <64072917+Mathieu-COSYNS@users.noreply.github.com>
41 lines
893 B
Plaintext
41 lines
893 B
Plaintext
---
|
|
group: Widgets
|
|
title: Boolean
|
|
weight: 10
|
|
---
|
|
|
|
- **Name**: `boolean`
|
|
- **UI**: Toggle switch
|
|
- **Data type**: `boolean`
|
|
|
|
The boolean widget translates a toggle switch input to a `true` or `false` value.
|
|
|
|
## Widget Options
|
|
|
|
For common options, see [Common widget options](/docs/widgets#common-widget-options).
|
|
|
|
| Name | Type | Default | Description |
|
|
| ------- | ------- | ------- | --------------------------------------------- |
|
|
| default | boolean | `false` | _Optional_. The default value for the field |
|
|
| prefix | string | `''` | _Optional_. Text to show before toggle switch |
|
|
| suffix | string | `''` | _Optional_. Text to show after toggle switch |
|
|
|
|
## Example
|
|
|
|
<CodeTabs>
|
|
```yaml
|
|
name: draft
|
|
label: Draft
|
|
widget: boolean
|
|
default: true
|
|
```
|
|
|
|
```js
|
|
name: 'draft',
|
|
label: 'Draft',
|
|
widget: 'boolean',
|
|
default: true,
|
|
```
|
|
|
|
</CodeTabs>
|