> This page is for Designer API.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://developers.webflow.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developers.webflow.com/_mcp/server.

# Get Selected Slot (Beta)

> Get the currently selected slot on a component instance.

## `element.getSelectedSlot()`

Returns the slot that is currently selected in the Designer on a component instance, or `null` if no slot is selected.

Use this to read the active slot context before appending or inspecting its children.

> **Beta**
>
> These methods are in public beta and may change with future releases.

## Syntax

```typescript
element.getSelectedSlot(): Promise<SlotInstanceElement | null>
```

## Returns

**Promise\<*SlotInstanceElement* | `null`>**

A Promise that resolves to the selected `SlotInstanceElement`, or `null` if no slot is currently selected.

## Example

```typescript
const elements = await webflow.getAllElements();
const componentInstance = elements.find(el => el.type === 'ComponentInstance');

if (componentInstance?.type === 'ComponentInstance') {
  const selectedSlot = await componentInstance.getSelectedSlot();

  if (selectedSlot) {
    const name = await selectedSlot.getDisplayName();
    console.log(`Selected slot: ${name}`);
  } else {
    console.log('No slot is currently selected');
  }
}
```

## Designer Ability

| Designer Ability    | Locale | Branch | Workflow | Sitemode |
| :------------------ | :----- | :----- | :------- | :------- |
| **canAccessCanvas** | Any    | Any    | Any      | Any      |