Skip to main content

sdk.illustrationapi.addillustration

Home > @kittl/sdk > IllustrationAPI > addIllustration

IllustrationAPI.addIllustration() method

Adds a new illustration to the design canvas.

This method creates a new illustration object by first retrieving the image dimensions from the provided source URL, then adding the illustration to the design state with the specified parameters and calculated dimensions.

Signature:

addIllustration(params: AddIllustrationParams, opts?: DesignApiOptions): Promise<NormalizedIllustrationObject>;

Parameters

Parameter

Type

Description

params

AddIllustrationParams

The parameters for creating the illustration

opts

DesignApiOptions

(Optional) Optional design API configuration options

Returns:

Promise<NormalizedIllustrationObject>

A promise that resolves to the result of the illustration creation operation

Exceptions

Will throw an error if the image dimensions cannot be retrieved