c55d1f912f
* v1.0.0-alpha44
38 lines
726 B
Plaintext
38 lines
726 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 |
|
|
|
|
## Example
|
|
|
|
<CodeTabs>
|
|
```yaml
|
|
name: draft
|
|
label: Draft
|
|
widget: boolean
|
|
default: true
|
|
```
|
|
|
|
```js
|
|
name: 'draft',
|
|
label: 'Draft',
|
|
widget: 'boolean',
|
|
default: true,
|
|
```
|
|
|
|
</CodeTabs> |