# Get component name

> 

## **`component.getName()`**

Get the name of the Component Object.

### Syntax

```typescript
component.getName(): Promise<string>
```

### Returns

**Promise\<`string`>**

A Promise that resolves to a `string` representing the name of a component.

```typescript
const myComponentName = "Hero-Component";
const components = await webflow.getAllComponents();

// Check if component exists
for (const c in components) {
  const currentComponentName = await components[c].getName();
  if (myComponentName === currentComponentName) {
    console.log("Found Hero Component");
  }
}
```

### Designer Ability

Checks for authorization only

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