ReadonlytypeThe type of the shape, which is always 'path' for path shapes.
The content of the boolean shape, defined as the path string.
The content of the boolean shape, defined as the path string.
The content of the boolean shape, defined as an array of path commands.
The fills applied to the shape.
ReadonlyidThe unique identifier of the shape.
The name of the shape.
ReadonlyparentThe parent shape. If the shape is the first level the parent will be the root shape. For the root shape the parent is null
ReadonlyparentReturns the index of the current shape in the parent
The x-coordinate of the shape's position.
The y-coordinate of the shape's position.
ReadonlywidthThe width of the shape.
ReadonlyheightThe height of the shape.
ReadonlyboundsReadonlycenterIndicates whether the shape is blocked.
Indicates whether the shape is hidden.
Indicates whether the shape is visible.
Indicates whether the shape has proportion lock enabled.
The horizontal constraints applied to the shape.
The vertical constraints applied to the shape.
The border radius of the shape.
The border radius of the top-left corner of the shape.
The border radius of the top-right corner of the shape.
The border radius of the bottom-right corner of the shape.
The border radius of the bottom-left corner of the shape.
The opacity of the shape.
The blend mode applied to the shape.
The shadows applied to the shape.
OptionalblurThe blur effect applied to the shape.
The export settings of the shape.
The x-coordinate of the shape relative to its board.
The y-coordinate of the shape relative to its board.
The x-coordinate of the shape relative to its parent.
The y-coordinate of the shape relative to its parent.
Indicates whether the shape is flipped horizontally.
Indicates whether the shape is flipped vertically.
The strokes applied to the shape.
Optional ReadonlylayoutLayout properties for children of the shape.
Optional ReadonlylayoutLayout properties for cells in a grid layout.
ReadonlytokensThe design tokens applied to this shape. It's a map property name -> token name.
NOTE that the tokens application is by name and not by id. If there exist several tokens with the same name in different sets, the actual token applied and the value set to the attributes will depend on which sets are active (and will change if different sets or themes are activated later).
ReadonlyinteractionsThe interactions for the current shape.
If we know the namespace of an external plugin, this is the way to get their data.
The namespace for the shared data.
The key for which to retrieve the data.
Returns the shared data associated with the key as a string.
Sets the shared plugin-specific data for the given namespace and key.
The namespace for the shared data.
The key for which to set the data.
The data to set for the key.
Retrieves all the keys for the shared plugin-specific data in the given namespace.
The namespace for the shared data.
Returns an array of strings representing all the keys in the namespace.
Changes the index inside the parent of the current shape. This method will shift the indexes of the shapes around that position to match the index. If the index is greater than the number of elements it will positioned last.
the new index for the shape to be in
Returns true if the current shape is inside a component instance
Returns true if the current shape is inside a component main instance
Returns true if the current shape is inside a component copy instance
Returns true when the current shape is the root of a component tree
Returns true when the current shape is the head of a components tree nested structure
Returns the equivalent shape in the component main instance. If the current shape is inside a
main instance will return null;
Returns the root of the component tree structure for the current shape. If the current shape is already a root will return itself.
Returns the head of the component tree structure for the current shape. If the current shape is already a head will return itself.
If the shape is a component instance, returns the reference to the component associated otherwise will return null
If the current shape is a component it will remove the component information and leave the shape as a "basic shape"
Switch a VariantComponent copy to the nearest one that has the specified property value
The position of the poroperty to update
The new value of the property
Combine several standard Components into a VariantComponent. Similar to doing it with the contextual menu on the Penpot interface. The current shape must be a component main instance.
A list of ids of the main instances of the components to combine with this one.
Returns true when the current shape is the head of a components tree nested structure, and that component is a VariantComponent
Moves the current shape to the front of its siblings
Moves the current shape one position forward in its list of siblings
Moves the current shape to the back of its siblings
Moves the current shape one position backwards in its list of siblings
Generates an export from the current shape.
Removes the interaction from the shape.
is the interaction to remove from the shape
Applies one design token to one or more properties of the shape.
is the Token to apply
an optional list of property names. If omitted, the default properties will be applied.
NOTE that the tokens application is by name and not by id. If there exist several tokens with the same name in different sets, the actual token applied and the value set to the attributes will depend on which sets are active (and will change if different sets or themes are activated later).
Creates a clone of the shape.
Returns a new instance of the shape with identical properties.
Removes the shape from its parent.
Represents a path shape in Penpot. This interface extends
ShapeBaseand includes properties and methods specific to paths.