static-cms/packages/docs/content/docs/widget-boolean.mdx
Daniel Lautzenheiser 799c7e6936
feat: v4.0.0 (#1016)
Co-authored-by: Denys Konovalov <kontakt@denyskon.de>
Co-authored-by: Mathieu COSYNS <64072917+Mathieu-COSYNS@users.noreply.github.com>
2024-01-03 15:14:09 -05:00

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>