- Name:
select
- UI: Select input
- Data type:
string
,number
,list of strings
orlist 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 17422_5460ff-cf> |
Type 17422_df5ed6-56> |
Default 17422_4d76b9-52> |
Description 17422_5b2c32-d4> |
---|---|---|---|
options 17422_188c26-5a> |
list of strings | 17422_e87482-bd> |
|
default 17422_06596c-15> |
string |
|
Optional. The default value for the field. Accepts a string. Defaults to an empty array if |
multiple 17422_13c988-0d> |
boolean 17422_d009b9-58> |
|
Optional. Allow multiple values/options to be selected 17422_6777af-3c> |
min 17422_4e690e-bb> |
number 17422_1b957b-d9> | 17422_493785-6f> |
Optional. Minimum number of items. Ignored if multiple is |
max 17422_2aa8f7-08> |
number 17422_e7369c-8f> | 17422_8702e7-d5> |
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: center
Options As Objects
name: airport-code
label: City
widget: select
options:
- label: Chicago
value: ORD
- label: Paris
value: CDG
- label: Tokyo
value: HND
name: '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: ORD
Multiple
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'],