TigriWeb Components
AttributesControlsMetaPrimitivesIntegrations
  • Table of Contents
  • Attributes
    • Checkbox
    • Color
    • ColorGradient
    • DateTime
    • Icon
    • Media
    • Number
    • PostType
    • PostTypeMultiple
    • Radio
    • Range
    • Select
    • Taxonomy
    • TaxonomyMultiple
    • Text
    • Textarea
    • Toggle
    • ToolbarButton
    • ToolbarGroup
  • Controls
    • AppenderButton
    • Media
    • RichHeading
    • RichText
  • Meta
    • Checkbox
    • Color
    • DateTime
    • Icon
    • Media
    • Number
    • PostType
    • PostTypeMultiple
    • Radio
    • Range
    • Select
    • Taxonomy
    • TaxonomyMultiple
    • Text
    • Textarea
    • Toggle
  • Primitives
    • HTML
    • SVG
  • Integrations
    • Enqueue SVG icons
    • Enqueue I18n strings
Powered by GitBook
On this page

Was this helpful?

  1. Attributes

ColorGradient

PreviousColorNextDateTime

Last updated 6 months ago

Was this helpful?

{ 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 }}
/>
TwebBlockColorGradientControl