sdk.textapi.addtext
Home > @kittl/sdk > TextAPI > addText
TextAPI.addText() method
Creates a new text element within the design artboard with customizable typography and positioning.
This method handles the creation and placement of text objects within the design state, providing comprehensive control over typography, positioning, and styling. It supports both absolute and relative positioning, custom sizing, and extensive font property configuration.
**Note**: Relative positioning for text elements is currently a work in progress and may not function as expected.
Signature:
addText(params: AddTextParams, opts?: DesignApiOptions): NormalizedRichTextObject;
Parameters
Parameter | Type | Description |
|---|---|---|
params | Configuration parameters for text creation | |
opts | (Optional) Optional design API configuration options |
Returns:
The newly created text object with all computed properties
Exceptions
When the text configuration is invalid or incomplete
When the specified artboard ID doesn't exist