Skip to content
This repository was archived by the owner on Apr 30, 2018. It is now read-only.

Commit 64ee7fb

Browse files
committed
added Select field
1 parent 5e4290d commit 64ee7fb

File tree

1 file changed

+68
-5
lines changed

1 file changed

+68
-5
lines changed

README.md

Lines changed: 68 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,8 @@ Below is a detailed description of each form fields and its custom properties.
147147

148148
#### Text form field
149149
>The text field allows single line input with a input element set to `type='text'`. It doesn't have any custom properties.
150-
##### default (string)
150+
151+
##### default (string, optional)
151152

152153
_Example text field_
153154
```json
@@ -162,7 +163,9 @@ _Example text field_
162163
---
163164
#### Textarea form field
164165
>The textarea field creates multiline input with a textarea element.
165-
##### default (string)
166+
167+
##### default (string, optional)
168+
166169
##### lines (number)
167170
>`lines` sets the rows attribute for the textarea element.
168171
@@ -180,7 +183,8 @@ _Example textarea field_
180183
---
181184
#### Checkbox form field
182185
>The checkbox field allows checkbox input with a input element set to `type='checkbox'`. It doesn't have any custom properties.
183-
##### default (boolean)
186+
187+
##### default (boolean, optional)
184188

185189
_Example checkbox field_
186190
```json
@@ -194,8 +198,10 @@ _Example checkbox field_
194198

195199
#### Radio form field
196200
>The radio field allows multiple choice input with a series of linked inputs, with `type='radio'`.
197-
##### default (string)
198-
>The default should be set to the `value` of one of the `options`.
201+
202+
##### default (string, optional)
203+
>The default can be set to the `value` of one of the `options`.
204+
199205
##### options (array)
200206
>`options` is an array of options for the radio form field to display. Each option should be an object with a `name`(string) and `value`(string or number).
201207
@@ -222,7 +228,64 @@ _Example radio field_
222228
]
223229
}
224230
```
231+
225232
#### Select form field
233+
>The select field allows selection via dropdown with the select element.
234+
235+
##### default (string)
236+
>The default can be set to the index of one of the `options`.
237+
238+
##### options (array)
239+
>`options` is an array of options for the select form field to display. Each option should be an object with a `name`(string). You may optionally add a `group` to some or all of your options.
240+
241+
_Example radio field_
242+
```json
243+
{
244+
"key": "transportation",
245+
"type": "select",
246+
"label": "How do you get around in the city",
247+
"options": [
248+
{
249+
"name": "Car"
250+
},
251+
{
252+
"name": "Helicopter"
253+
},
254+
{
255+
"name": "Sport Utility Vehicle"
256+
},
257+
{
258+
"name": "Bicycle",
259+
"group": "low emissions"
260+
},
261+
{
262+
"name": "Skateboard",
263+
"group": "low emissions"
264+
},
265+
{
266+
"name": "Walk",
267+
"group": "low emissions"
268+
},
269+
{
270+
"name": "Bus",
271+
"group": "low emissions"
272+
},
273+
{
274+
"name": "Scooter",
275+
"group": "low emissions"
276+
},
277+
{
278+
"name": "Train",
279+
"group": "low emissions"
280+
},
281+
{
282+
"name": "Hot Air Baloon",
283+
"group": "low emissions"
284+
}
285+
]
286+
}
287+
```
288+
226289
#### Number form field
227290
#### Password form field
228291
#### Hidden form field

0 commit comments

Comments
 (0)