From 782eaf82f3d33ad284bad582765746d57d7268cb Mon Sep 17 00:00:00 2001 From: Keegan Date: Sat, 28 May 2016 14:50:06 -0700 Subject: [PATCH] Document optgroups for selects --- README.md | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/README.md b/README.md index b0926d4..231e83b 100755 --- a/README.md +++ b/README.md @@ -291,6 +291,60 @@ A dropdown menu containing multiple options. } ``` +If you wish to use optgroups, then use the following format: + +```javascript +{ + "type": "select", + "appKey": "flavor", + "defaultValue": "grape", + "label": "Favorite Flavor", + "options": [ + { + "label": "", + "value": "" + }, + { + "label": "Fruits", + "value": [ + { + "label": "Berry", + "value": "berry" + }, + { + "label": "Grape", + "value": "grape" + }, + { + "label": "Banana", + "value": "banana" + } + ] + }, + { + "label": "Candy", + "value": [ + { + "label": "Chocolate", + "value": "chocolate" + }, + { + "label": "Cream", + "value": "cream" + }, + { + "label": "Lollipop", + "value": "lollipop" + } + ] + } + ], + "attributes": { + "required": "required" + } +} +``` + --- #### Color Picker