---
title: ShapeMarkup
framework: paperkit
role: symbol
role_heading: Structure
path: paperkit/shapemarkup
---

# ShapeMarkup

A markup element that represents a shape or text box with customizable appearance and behavior.

## Declaration

```swift
struct ShapeMarkup
```

## Overview

Overview Use ShapeMarkup to add geometric shapes, lines, and text containers to your markup content. Shapes can be filled, stroked, rotated, and configured with various visual properties. // Create a filled rectangle let rect = ShapeMarkup(     frame: CGRect(x: 0, y: 0, width: 100, height: 50),     fillColor: CGColor(red: 0, green: 0, blue: 1, alpha: 1),     type: .rectangle )

// Create a resizable textbox var textBox = ShapeMarkup(     frame: CGRect(x: 0, y: 0, width: 80, height: 80),     type: .rectangle,     attributedText: AttributedString("Star!"),     flags: [.flexibleWidth] ) textBox.attributedText = AttributedString("This text will cause the box to expand")

// Create an arrow line let arrow = ShapeMarkup(     frame: CGRect(x: 0, y: 0, width: 200, height: 2),     strokeColor: CGColor(red: 0, green: 0, blue: 0, alpha: 1),     type: .line(start: .zero, control: CGPoint(x: 0.5, y: 0), end: CGPoint(x: 1, y: 0)),     endLineMarker: .arrow )

## Topics

### Configuring fill and stroke

- [fillColor](paperkit/shapemarkup/fillcolor.md)
- [strokeColor](paperkit/shapemarkup/strokecolor.md)
- [lineWidth](paperkit/shapemarkup/linewidth.md)
- [opacity](paperkit/shapemarkup/opacity.md)

### Identifying markup

- [id](paperkit/shapemarkup/id.md)

### Initializers

- [init(configuration:frame:rotation:)](paperkit/shapemarkup/init(configuration:frame:rotation:).md)
- [init(shape:frame:rotation:fillColor:strokeColor:lineWidth:opacity:startLineMarker:endLineMarker:attributedText:allowedInteractions:autoresizing:id:)](paperkit/shapemarkup/init(shape:frame:rotation:fillcolor:strokecolor:linewidth:opacity:startlinemarker:endlinemarker:attributedtext:allowedinteractions:autoresizing:id:).md)

### Instance Properties

- [attributedText](paperkit/shapemarkup/attributedtext.md)
- [autoresizing](paperkit/shapemarkup/autoresizing.md)
- [endLineMarker](paperkit/shapemarkup/endlinemarker.md)
- [shape](paperkit/shapemarkup/shape-swift.property.md)
- [shapeScaled](paperkit/shapemarkup/shapescaled.md)
- [startLineMarker](paperkit/shapemarkup/startlinemarker.md)

### Enumerations

- [ShapeMarkup.LineMarker](paperkit/shapemarkup/linemarker.md)
- [ShapeMarkup.Shape](paperkit/shapemarkup/shape-swift.enum.md)

## Relationships

### Conforms To

- [Identifiable](swift/identifiable.md)
- [Markup](paperkit/markup.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Markup elements

- [Markup](paperkit/markup.md)
- [ImageMarkup](paperkit/imagemarkup.md)
- [LinkMarkup](paperkit/linkmarkup.md)
- [LoupeMarkup](paperkit/loupemarkup.md)
- [MarkupInteractions](paperkit/markupinteractions.md)
