Skip to main content

sdk.textapi

Home > @kittl/sdk > TextAPI

TextAPI interface

API for creating and managing text elements in the design.

Signature:

export interface TextAPI 

Methods

Method

Description

addText(params, opts)

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.

updateText(params, opts)

Modifies the content and properties of existing text elements within the design artboard.

This method allows comprehensive updating of text objects including content modification, positioning, and rotation properties. All parameters except textId are optional, allowing for selective updates of specific text properties.