static-cms/website/content/docs/widget-boolean.mdx

38 lines
726 B
Plaintext
Raw Normal View History

2022-09-30 11:39:35 -04:00
---
group: Widgets
title: Boolean
weight: 10
2022-09-30 11:39:35 -04:00
---
2022-11-02 15:42:21 -04:00
- **Name**: `boolean`
- **UI**: Toggle switch
- **Data type**: `boolean`
The boolean widget translates a toggle switch input to a `true` or `false` value.
2022-09-30 11:39:35 -04:00
## Widget options
For common options, see [Common widget options](/docs/widgets#common-widget-options).
2022-11-02 15:42:21 -04:00
| 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>