Skip to content

Selection Tool

The snaptrude.tools.selection namespace allows you to access the currently selected components in the editor.

Functions

get()

Retrieves the list of currently selected components.

  • Returns: Component[] - An array of selected components.
typescript
const selection = snaptrude.tools.selection.get();
if (selection.length > 0) {
  console.log(`${selection.length} items selected.`);
}