-
Notifications
You must be signed in to change notification settings - Fork 8
MultiSelectControl
Junaid Bhura edited this page Apr 22, 2019
·
1 revision
import { MultiSelectControl } = gumponents.components;
...
attributes: {
simpsons: {
type: 'array',
default: [],
},
},
...
const options = [
{ value: 'bart', label: 'Bart' },
{ value: 'homer', label: 'Homer' },
{ value: 'marge', label: 'Marge' },
];
<MultiSelectControl
label="Choose Simpsons"
help="Choose your favorite characters."
options={ options }
value={ attributes.simpsons }
onChange={ ( simpsons ) => setAttributes( { simpsons } ) }
placeholder="D'oh"
/>
The label for the control.
- Type:
String
- Required: No
The help text for the control.
- Type:
String
- Required: No
The select options for this control.
- Type:
Array
- Required: Yes
The selected values for this control.
- Type:
Array
- Required: Yes
A function that receives the values of the control.
- Type:
Function
- Required: Yes
The placeholder which displays within the control.
- Type:
String
- Required: No