Skip to content

Commit

Permalink
Add explaination for prefix and suffix for supported widgets
Browse files Browse the repository at this point in the history
  • Loading branch information
martinjagodic committed Mar 29, 2024
1 parent d4cdf27 commit 65508cd
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
4 changes: 3 additions & 1 deletion content/docs/widgets/boolean.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ The boolean widget translates a toggle switch input to a true/false value.
- **Data type:** boolean
- **Options:**
- `default`: accepts `true` or `false`; defaults to `false` when `required` is set to `false`
- `prefix`: <a href="https://github.com/decaporg/decap-cms/releases/tag/decap-cms%403.1.6" class="version-tag">3.1.6</a> display a message before the toggle; accepts a string; defaults to an empty string
- `suffix`: display a message after the toggle; accepts a string; defaults to an empty string
- **Example:**
```yaml
- {label: "Draft", name: "draft", widget: "boolean", default: true}
- {label: "Draft", name: "draft", widget: "boolean", default: true, prefix: "OFF", suffix: "ON"}
```
3 changes: 3 additions & 0 deletions content/docs/widgets/number.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ The number widget uses an HTML number input, saving the value as a string, integ
- `min`: accepts a number for minimum value accepted; unset by default
- `max`: accepts a number for maximum value accepted; unset by default
- `step`: accepts a number for stepping up/down values in the input; 1 by default
- `prefix`: <a href="https://github.com/decaporg/decap-cms/releases/tag/decap-cms%403.1.6" class="version-tag">3.1.6</a> display a message before the number input; accepts a string; defaults to an empty string
- `suffix`: display a message after the number input; accepts a string; defaults to an empty string
- **Example:**
```yaml
- label: "Puppy Count"
Expand All @@ -24,4 +26,5 @@ The number widget uses an HTML number input, saving the value as a string, integ
min: 1
max: 101
step: 2
suffix: "puppies"
```
2 changes: 2 additions & 0 deletions content/docs/widgets/string.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ The string widget translates a basic text input to a string value. For larger te
- **Data type:** string
- **Options:**
- `default`: accepts a string; defaults to an empty string
- `prefix`: <a href="https://github.com/decaporg/decap-cms/releases/tag/decap-cms%403.1.6" class="version-tag">3.1.6</a> display a message before the string input; accepts a string; defaults to an empty string
- `suffix`: display a message after the string input; accepts a string; defaults to an empty string
- **Example:**
```yaml
- {label: "Title", name: "title", widget: "string"}
Expand Down

0 comments on commit 65508cd

Please sign in to comment.