Skip to content

Commit e9e3b31

Browse files
committed
document optgroup for backend forms dropdown field
1 parent 6418b6c commit e9e3b31

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

backend/forms.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,26 @@ status_type:
440440
draft: [Draft, icon-clock-o]
441441
```
442442

443+
#### Add option grouping (optgroup) to dropdown options
444+
445+
In order to add option grouping, use a multidimensional array like below:
446+
447+
```yaml
448+
status_type:
449+
type: dropdown
450+
label: Blog Post Status
451+
options:
452+
Group1:
453+
opt1: Option 1
454+
opt2: Option 2
455+
opt3: Option 3
456+
Group2:
457+
opt4: Option 4
458+
opt5: [Option 5, icon-check-circle]
459+
opt6: Option 6
460+
```
461+
>**NOTE:** individual items in the groups can also use icons or images as shown in "Option 5" above.
462+
443463
To define the behavior when there is no selection, you may specify an `emptyOption` value to include an empty option that can be reselected.
444464

445465
```yaml

0 commit comments

Comments
 (0)