Media
Last updated
Was this helpful?
Last updated
Was this helpful?
/**
* @param {string} name - Attribute name.
* @param {string} [size] - Size of the image, e.g., 'thumbnail', 'medium', 'large'.
* @param {function} [onSelect] - Callback called when a media item is selected.
* @param {function} [customUrl] - Add a custom media URL button.
* @param {object} attributes - Object containing block attributes.
* @param {function} setAttributes - Function to set new block attribute values.
*/
"testMedia": {
"type": "object",
"default": {}
},
import {
TwebBlockMedia,
} from '@tigriweb/components/controls';
<TwebBlockMedia
name="testMedia"
size="thumbnail"
{...{ attributes, setAttributes }}
/>
{ attributes.testMedia.url && (
<div className="custom-image">
<TwebBlockMedia.Content
value={ attributes.testMedia }
/>
</div>
) }