Skip to main content

Shape API Reference

kittl.design.shape — create and update shapes.

Scope: design:state:write

createPredefinedShape(params)

Creates a predefined shape (rectangle, circle, star, triangle).

PropertyTypeRequiredDescription
shape'rectangle' | 'ellipse' | 'star' | 'polygon'YesShape type
positionAbsolutePosition | RelativePositionYesPlacement on canvas
size{ width, height, applyViewportScale? }NoDimensions
shapePropertiesShapePropertiesNoOptional styling

Returns: SdkResultAsync<NormalizedBasicShapeObject>

createBasicShape(params)

Creates a shape from an SVG path string.

PropertyTypeRequiredDescription
svgPathstringYesSVG path data
positionAbsolutePosition | RelativePositionYesPlacement on canvas
size{ width, height, applyViewportScale? }NoDimensions

Returns: SdkResultAsync<NormalizedBasicShapeObject>

updateShape(params)

Updates properties of an existing shape.

PropertyTypeRequiredDescription
idstringYesID of the shape to update
positionAbsolutePosition | RelativePositionNoNew position
size{ width, height, applyViewportScale? }NoNew dimensions
anglenumberNoRotation in degrees
opacitynumberNoOpacity (0–1)
flipX / flipYbooleanNoFlip horizontally/vertically
skewX / skewYnumberNoSkew transforms
fillColorInfo[]NoFill array — each entry has key, value, and visible
fillColorColorNoConvenience shortcut — sets a single fill value
strokestringNoStroke color
strokeWidthnumberNoStroke width in pixels
cornerRadiinumber[]NoCorner radius values
shadowOptionsobjectNoShadow configuration
hiddenbooleanNoVisibility
namestringNoCustom name

convertShapeToMask(params)

Converts a basic shape into a mask group. The shape must be directly on a board.

PropertyTypeRequiredDescription
idstringYesID of the shape to convert