Skip to main content

Overview

Creates a new instance of an existing component at the specified position. The component must exist in the current document.

Parameters

string
required
Key of the component to instantiate. Get this from get_local_components
number
required
X position where the instance will be created
number
required
Y position where the instance will be created

Response

Returns information about the created instance:
string
Unique node identifier for the created instance
string
Name of the instance (inherited from the component)
number
X position of the instance
number
Y position of the instance
string
Key of the main component this instance references

Usage Example

Common Use Cases

Rapid Prototyping

Quickly populate designs with component instances

Batch Creation

Create multiple instances programmatically for layouts

Design Automation

Automate repetitive instance placement tasks

Template Generation

Generate templated screens with consistent components

Workflow

1

Get components

Use get_local_components to find available components
2

Create instance

Call create_component_instance with the component key and position
3

Customize instance (optional)

Use get_instance_overrides and set_instance_overrides to apply customizations

Error Handling

The component key must be valid and from a component in the current document. Using an invalid key will result in an error.

Notes

  • The created instance inherits all properties from the main component
  • Position is absolute on the current page
  • The instance can be modified after creation using other tools
  • Component must be from the current document (library components require different handling)