ToolbarButton

TwebToolbarButton

{ label, icon*, name*, onClick, attributes*, setAttributes* }
/**
 * @param {string} [label] - Component label.
 * @param {JSX.Element} icon - Component icon.
 * @param {string} name - Attribute name.
 * @param {function} [onClick] - Function called when the button is clicked.
 * @param {object} attributes - Object containing block attributes.
 * @param {function} setAttributes - Function to set new block attribute values.
 */
block.json
"isFullScreen": {
	"type": "boolean",
	"default": false
},
index.js
import {
	TwebSVG,
} from '@tigriweb/components/primitives';

import {
	TwebToolbarButton,
} from '@tigriweb/components/attributes';
index.js | edit()
<TwebToolbarButton
	icon={ <TwebSVG icon="arrow-autofit-height" /> }
	label={ __('Toggle full height', 'your-theme-name') }
	name="isFullScreen"
	{ ...{ attributes, setAttributes } }
/>

Last updated

Was this helpful?