ColorGradient

TwebBlockColorGradientControl

{ label, nameColor*, nameGradient*, onColorChange, onGradientChange, attributes*, setAttributes* }
/**
 * @param {string} [label] - Component label.
 * @param {string} nameColor - Attribute color name.
 * @param {string} nameGradient - Attribute gradient name.
 * @param {function} [onColorChange] - Callback called when the color value changes.
 * @param {function} [onGradientChange] - Callback called when the gradient value changes.
 * @param {object} attributes - Object containing block attributes.
 * @param {function} setAttributes - Function to set new block attribute values.
 */
block.json
"testColor": {
	"type": "string",
	"default": ""
},
"testGradient": {
	"type": "string",
	"default": null
}
index.js
import {
	TwebBlockColorGradientControl,
} from '@tigriweb/components/attributes';
index.js | edit()
<TwebBlockColorGradientControl
	label={ __('Color Label', 'your-theme-name') }
	nameColor="testColor"
	nameGradient="testGradient"
	{...{ attributes, setAttributes }}
/>

Last updated

Was this helpful?