> For the complete documentation index, see [llms.txt](https://docs.renderdraw.us/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.renderdraw.us/usage-scenarios/use-cases/interacting-with-renderdraw-using-lightning-messaging-service-lms/canvas-element-selected.md).

# Canvas Element Selected

**Overview:**\
This channel is dedicated to when an element within the canvas is selected by the user. It supports both 2D and 3D canvas interactions.

**Usage:**\
Used to trigger actions or display information related to the selected element in either a 2D or 3D canvas context.

**Parameters:**

* **contextId**: The ID for the context of the 2D or 3D canvas.
* **elementId**: The ID of the selected element.
* **elementType**: The type of the selected element, indicating the shape or canvas element type in 2D (e.g., layoutArea), or component in 3D.
* **elementName**: The name of the selected element.
* **record**: The associated record of the selected element, where applicable.

**Channel Name (for import):**

```javascript
import CANVAS_ELEMENTSELECTED_CHANNEL from "@salesforce/messageChannel/RDraw__Canvas_ElementSelected__c";
```

**Publisher Components:**

* canvas3D
* canvas2D

**Subscriber Components:**

* standalone\_DataTable
* groupSelection
