Last updated 9 days ago
TwebBlockToggleControl
/** * @param {string} [label] - Component label. * @param {string} [help] - Component description. * @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. */
"testToggle": { "type": "boolean", "default": true }
import { TwebBlockToggleControl, } from '@tigriweb/components/attributes';
<TwebBlockToggleControl label={ [ __('Toggle Title On', 'your-theme-name'), __('Toggle Title Off', 'your-theme-name'), ] } help={ [ __('Toggle Description On', 'your-theme-name'), __('Toggle Description Off', 'your-theme-name'), ] } name="testToggle" { ...{ attributes, setAttributes } } />
<TwebBlockToggleControl label={ __('Toggle Label', 'your-theme-name') } help={ __('Toggle Description', 'your-theme-name') } name="testToggle" { ...{ attributes, setAttributes } } />