- Name:
select - UI: Select input
- Data type:
string,number,list of stringsorlist of numbers
The select widget allows you to pick a string value from a dropdown menu.
Widget Options
For common options, see Common widget options.
|
Name |
Type |
Default |
Description |
|---|---|---|---|
|
options |
list of strings |
| |
|
default |
string |
|
Optional. The default value for the field. Accepts a string. Defaults to an empty array if |
|
multiple |
boolean |
|
Optional. Allow multiple values/options to be selected |
|
min |
number |
Optional. Minimum number of items. Ignored if multiple is | |
|
max |
number |
Optional. Maximum number of items; ignored if multiple is |
Examples
Options As Strings
name: align
label: Align Content
widget: select
options: ['left', 'center', 'right']name: 'align',
label: 'Align Content',
widget: 'select',
options: ['left', 'center', 'right'],Selecting the center option, will save the value as:
align: centerOptions As Objects
name: airport-code
label: City
widget: select
options:
- label: Chicago
value: ORD
- label: Paris
value: CDG
- label: Tokyo
value: HNDname: 'airport-code',
label: 'City',
widget: 'select',
options: [
{
label: 'Chicago',
value: 'ORD'
},
{
label: 'Paris',
value: 'CDG'
},
{
label: 'Tokyo',
value: 'HND'
},
],Selecting the Chicago option, will save the value as:
airport-code: ORDMultiple
name: 'tags'
label: 'Tags'
widget: 'select'
multiple: true
options: ['Design', 'UX', 'Dev']
default: ['Design']name: 'tags',
label: 'Tags',
widget: 'select',
multiple: true,
options: ['Design', 'UX', 'Dev'],
default: ['Design'],Min and Max
name: 'tags'
label: 'Tags'
widget: 'select'
multiple: true
min: 1
max: 3
options: ['Design', 'UX', 'Dev']
default: ['Design']name: 'tags',
label: 'Tags',
widget: 'select',
multiple: true,
min: 1,
max: 3,
options: ['Design', 'UX', 'Dev'],
default: ['Design'],