# TextLayer.createStroke
Creates or replaces the stroke on this text layer.

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

## TextLayer.createStroke() method

Creates or replaces the stroke on this text layer.

**Signature:**

```typescript
createStroke(opts: TextStrokeOptions): TextStroke;
```

## Parameters

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

      <th>
        Type
      </th>

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

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

      <td>
        [TextStrokeOptions](/en/creator-api/types/text-stroke-options)
      </td>

      <td>
        Options describing the stroke color and width.
      </td>
    </tr>
  </tbody>
</table>

**Returns:** [TextStroke](/en/creator-api/types/text-stroke)

The created (or replaced) stroke.

## Example

```ts
textLayer.createStroke({
  fill: { type: "SOLID", color: { r: 0, g: 0, b: 0 } },
  width: 2,
});
```
