Back to Grapesjs

Layer

docs/api/layer.md

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

getId

Get layer id.

Returns String

getIndex

Get layer index.

Returns Number

getValues

Get layer values.

Parameters

  • opts Object Options (optional, default {})

    • opts.camelCase Boolean? Return property names in camelCase.

Returns Object

getLabel

Get layer label.

Returns String

isSelected

Check if the layer is selected.

Returns Boolean

select

Select the layer.

remove

Remove the layer.

move

Move layer to a new index.

Parameters

getStylePreview

Get style object for the preview.

Parameters

  • opts Object Options. Same of PropertyStack.getStyleFromLayer (optional, default {})

Returns Object Style object

hasPreview

Check if the property has the preview enabled for this layer.

Returns Boolean