> 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 the selected component (Beta)

> Retrieves the component that is currently being edited

## `webflow.getCurrentComponent()`

Retrieves the component that is currently being edited.

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

### Syntax

```typescript
webflow.getCurrentComponent(): Promise<Component | null>
```

### Returns

**Promise\<*Component*>**

A Promise that resolves to a component or null if no component is currently being edited.

### Example

```typescript
const component = await webflow.getCurrentComponent();
if (component) {
  const name = await component.getName();
  console.log(`Currently editing component: ${name}`);
  // Example: get all elements inside the active component
  const root = await component.getRootElement();
  const children = await root.getChildren();
  console.log(`Root has ${children.length} child element(s)`);
} else {
  console.log('Not currently editing a component.');
}
```

[Try this example](https://webflow.com/oauth/authorize?response_type=code\&client_id=19511de1ec410f9228d8dcbc9420e67916dea80d86d18f0c9a533eb475ea0f62)

---

### Designer Ability

Checks for authorization only

| Designer Ability    | Permission | Locale | Branch | Workflow | Sitemode |
| :------------------ | :--------- | :----- | :----- | :------- | :------- |
| **canAccessCanvas** | any        | any    | any    | any      | any      |