# ShapeContainerMixin.createPolygon
Creates a new polygon shape in this container

{/* Do not edit this file. It is automatically generated by API Documenter. */}

## ShapeContainerMixin.createPolygon() method

Creates a new polygon shape in this container

**Signature:**

```typescript
createPolygon(opts?: PolygonOptions): Polygon;
```

## Parameters

<table>
  <thead>
    <tr>
      <th>
        Parameter
      </th>

      <th>
        Type
      </th>

      <th>
        Description
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        opts
      </td>

      <td>
        [PolygonOptions](../../types/polygon-options)
      </td>

      <td>
        _(Optional)_ Optional configuration for the polygon
      </td>
    </tr>
  </tbody>
</table>

**Returns:**

[Polygon](../polygon)

The newly created polygon

## Example

```ts
// Create a polygon shape
const polygon = await layer.createPolygon({
  position: { x: 100, y: 100 },
  points: 5,
  innerRadius: 25,
  outerRadius: 50,
});
```
