Skip to main content

Text API Reference

kittl.design.text — add and update text elements.

Scope: design:state:write

addText(params)

Adds a new text element to the canvas.

PropertyTypeRequiredDescription
textstringYesThe text content
positionAbsolutePosition | RelativePositionYesPlacement on canvas
size{ width, height, applyViewportScale? }NoText box dimensions
textPropertiesTextPropertiesNoStyling (see below)

Returns: SdkResultAsync<NormalizedRichTextObject>

updateText(params)

Updates an existing text element.

PropertyTypeRequiredDescription
textIdstringYesID of the text to update
textstringNoNew text content
leftnumberNoX position
topnumberNoY position
anglenumberNoRotation in degrees
...TextPropertiesNoAny TextProperties field

updateRenderPlugin(params)

Updates a render plugin (e.g. shadow) on a text element.

PropertyTypeRequiredDescription
textIdstringYesID of the text element
renderPluginIdstringYesID of the render plugin
renderPluginPartial<RichTextRenderPluginSerializedObject>YesPlugin properties to update

Render Plugin Properties

PropertyTypeDescription
namestringPlugin name/type identifier
versionstringPlugin version
colorstringColor for the rendered shadow
anglenumberAngle of the rendered shadow
offsetnumberOffset distance of the rendered shadow

updateDecorationPlugin(params)

Updates a decoration plugin on a text element.

PropertyTypeRequiredDescription
textIdstringYesID of the text element
decorationPluginIdstringYesID of the decoration plugin
decorationPluginPartial<RichTextDecorationPluginSerializedObject>YesPlugin properties to update

Decoration Plugin Properties

PropertyTypeDescription
namestringPlugin name/type identifier
versionstringPlugin version
fillStylestringFill style/color for the decoration

TextProperties

All properties are optional. Used both when adding and updating text.

PropertyTypeDescription
fontFamilystringFont family name (e.g. 'Inter', 'Helvetica')
fontSizenumberFont size in pixels
fontWeightstring | numberWeight (e.g. 'Regular', 'Bold', 400, 700)
fillColorText color — CSS color string or gradient object
textAlign'left' | 'center' | 'right' | 'justify'Horizontal alignment
lineHeightnumberLine height multiplier (e.g. 1.16)
charSpacingnumberLetter spacing in thousandths of an em (0 = normal)
resizeBehavior'none' | 'hug' | 'hug-height'Text box resize mode
underlinebooleanUnderline decoration
overlinebooleanOverline decoration
linethroughbooleanStrikethrough decoration
anglenumberRotation in degrees (positive = clockwise)
scaleXnumberHorizontal scale factor (1 = normal)
scaleYnumberVertical scale factor (1 = normal)
strokestringStroke color (CSS color string)
strokeWidthnumberStroke width in pixels