Back to Grapesjs

Block

docs/api/block.md

0.22.161.9 KB
Original Source
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->

Block

Properties

  • label String Block label, eg. My block
  • content (String | Object) The content of the block. Might be an HTML string or a Component Definition
  • media String? HTML string for the media/icon of the block, eg. <svg ..., editor.getWrapper().append(block.get('content'))
  • attributes Object? Block attributes to apply in the view element

getId

Get block id

Returns String

getLabel

Get block label

Returns String

getMedia

Get block media

Returns String

getContent

Get block content

Returns (Object | String | Array<(Object | String)>)

getDragDef

Get block component dragDef

Returns ComponentDefinition

getCategoryLabel

Get block category label

Returns String