<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macOS: 27.0.0 -",
    "visionOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "PaperKit",
  "identifier" : "/documentation/PaperKit/ShapeMarkup/init(shape:frame:rotation:fillColor:strokeColor:lineWidth:opacity:startLineMarker:endLineMarker:attributedText:allowedInteractions:autoresizing:id:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "PaperKit"
    ],
    "preciseIdentifier" : "s:8PaperKit11ShapeMarkupV5shape5frame8rotation9fillColor06strokeI09lineWidth7opacity15startLineMarker03endoP014attributedText19allowedInteractions12autoresizing2idA2C0C0O_So6CGRectV14CoreFoundation7CGFloatVSo10CGColorRefaSgAz2wC0oP0OA0_0Z016AttributedStringVAA0dU0VAA0D12AutoresizingVAA0D2IDVyACGtcfc"
  },
  "title" : "init(shape:frame:rotation:fillColor:strokeColor:lineWidth:opacity:startLineMarker:endLineMarker:attributedText:allowedInteractions:autoresizing:id:)"
}
-->

# init(shape:frame:rotation:fillColor:strokeColor:lineWidth:opacity:startLineMarker:endLineMarker:attributedText:allowedInteractions:autoresizing:id:)

Initializes and returns a new shape markup from the specified parameters.

```
init(shape: ShapeMarkup.Shape, frame: CGRect, rotation: CGFloat = 0.0, fillColor: CGColor? = nil, strokeColor: CGColor? = nil, lineWidth: CGFloat = 1.0, opacity: CGFloat = 1.0, startLineMarker: ShapeMarkup.LineMarker = .none, endLineMarker: ShapeMarkup.LineMarker = .none, attributedText: AttributedString = Foundation.AttributedString(), allowedInteractions: MarkupInteractions = .all, autoresizing: MarkupAutoresizing = [], id: MarkupID<ShapeMarkup> = MarkupID())
```

## Parameters

`shape`

The shape to create.

`frame`

The frame of the shape.

`rotation`

The rotation in radians of the shape. Defaults to `0.0` (no rotation).

`fillColor`

The fill color of the shape. Defaults to `nil` (no fill).

`strokeColor`

The stroke color of the shape’s outline. Defaults to `nil` (no stroke).

`lineWidth`

The width of the shape’s stroke. Defaults to `1.0`.

`opacity`

The opacity of the shape, ranging from `0.0` (fully transparent) to `1.0` (fully opaque). Defaults to `1.0`.

`startLineMarker`

The marker style for the start of the line. Defaults to `.none`. Only applicable for open shape paths.

`endLineMarker`

The marker style for the end of the line. Defaults to `.none`. Only applicable for open shape paths.

`attributedText`

The attributed text displayed inside this shape. Defaults to the empty string.

`allowedInteractions`

The flags controlling the interactions users can perform. Defaults to `.all`.

`autoresizing`

The flags controlling autoresize behavior. Defaults to `[]`.

`id`

The identity of the shape. Defaults to a unique id.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)