Select

TwebBlockSelectControl

{ label, help, choices*, name*, onChange, attributes*, setAttributes* }
/**
 * @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.
 */
block.json
"testSelect": {
	"type": "string",
	"default": "choice3"
}
index.js
import {
	TwebBlockSelectControl,
} from '@tigriweb/components/attributes';
index.js | edit()
<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 } }
/>

Last updated

Was this helpful?