Select
Last updated
Last updated
/**
* @param {string} [label] - Component label.
* @param {string} [help] - Component description.
* @param {object} choices - Object containing key-value pairs options.
* @param {string} name - Attribute name.
* @param {function} [onChange] - Callback called when the value changes.
* @param {object} attributes - Object containing block attributes.
* @param {function} setAttributes - Function to set new block attribute values.
*/
"testSelect": {
"type": "string",
"default": "choice3"
}
import {
TwebBlockSelectControl,
} from '@tigriweb/components/attributes';
<TwebBlockSelectControl
label={ __('Select Label', 'your-theme-name') }
help={ __('Select Description', 'your-theme-name') }
choices={ {
'choice1': __('Choise 1', 'your-theme-name'),
'choice2': __('Choise 2', 'your-theme-name'),
'choice3': __('Choise 3', 'your-theme-name'),
} }
name="testSelect"
{ ...{ attributes, setAttributes } }
/>