# ShapeContainerMixin.createRectangle
Creates a new rectangle shape in this container

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

## ShapeContainerMixin.createRectangle() method

Creates a new rectangle shape in this container

**Signature:**

```typescript
createRectangle(opts?: RectangleOptions): Rectangle;
```

## Parameters

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

      <th>
        Type
      </th>

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

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

      <td>
        [RectangleOptions](../../types/rectangle-options)
      </td>

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

**Returns:**

[Rectangle](../rectangle)

The newly created rectangle

## Example

```ts
// Create a rectangle shape
const rectangle = await layer.createRectangle({
  position: { x: 100, y: 100 },
  size: { width: 200, height: 100 },
  roundness: 10,
});
```
