Shape API Reference
kittl.design.shape — create and update shapes.
Scope: design:state:write
createPredefinedShape(params)
Creates a predefined shape (rectangle, circle, star, triangle).
| Property | Type | Required | Description |
|---|---|---|---|
shape | 'rectangle' | 'ellipse' | 'star' | 'polygon' | Yes | Shape type |
position | AbsolutePosition | RelativePosition | Yes | Placement on canvas |
size | { width, height, applyViewportScale? } | No | Dimensions |
shapeProperties | ShapeProperties | No | Optional styling |
Returns: SdkResultAsync<NormalizedBasicShapeObject>
createBasicShape(params)
Creates a shape from an SVG path string.
| Property | Type | Required | Description |
|---|---|---|---|
svgPath | string | Yes | SVG path data |
position | AbsolutePosition | RelativePosition | Yes | Placement on canvas |
size | { width, height, applyViewportScale? } | No | Dimensions |
Returns: SdkResultAsync<NormalizedBasicShapeObject>
updateShape(params)
Updates properties of an existing shape.
| Property | Type | Required | Description |
|---|---|---|---|
id | string | Yes | ID of the shape to update |
position | AbsolutePosition | RelativePosition | No | New position |
size | { width, height, applyViewportScale? } | No | New dimensions |
angle | number | No | Rotation in degrees |
opacity | number | No | Opacity (0–1) |
flipX / flipY | boolean | No | Flip horizontally/vertically |
skewX / skewY | number | No | Skew transforms |
fill | ColorInfo[] | No | Fill array — each entry has key, value, and visible |
fillColor | Color | No | Convenience shortcut — sets a single fill value |
stroke | string | No | Stroke color |
strokeWidth | number | No | Stroke width in pixels |
cornerRadii | number[] | No | Corner radius values |
shadowOptions | object | No | Shadow configuration |
hidden | boolean | No | Visibility |
name | string | No | Custom name |
convertShapeToMask(params)
Converts a basic shape into a mask group. The shape must be directly on a board.
| Property | Type | Required | Description |
|---|---|---|---|
id | string | Yes | ID of the shape to convert |