<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macOS: 27.0.0 -",
    "visionOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "PaperKit",
  "identifier" : "/documentation/PaperKit/MarkupAutoresizing",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "PaperKit"
    ],
    "preciseIdentifier" : "s:8PaperKit18MarkupAutoresizingV"
  },
  "title" : "MarkupAutoresizing"
}
-->

# MarkupAutoresizing

Automatic sizing behaviors for this markup.

```
struct MarkupAutoresizing
```

## Overview

Controls whether the markup automatically adjusts its dimensions to fit content changes.

```swift
var textBox = ShapeMarkup(
    shape: .rectangle,
    frame: CGRect(x: 0, y: 0, width: 100, height: 50),
    attributedText: AttributedString("Short"),
    autoresizing: [.flexibleWidth]
)

textBox.attributedText = AttributedString("This is much longer text")
// textBox.frame.width is unaffected, but textBox.renderFrame.width has automatically increased
```

## Topics

### Resizing options

[`static let flexibleHeight: MarkupAutoresizing`](/documentation/PaperKit/MarkupAutoresizing/flexibleHeight)

Automatically adjust height to fit content changes.

[`static let flexibleWidth: MarkupAutoresizing`](/documentation/PaperKit/MarkupAutoresizing/flexibleWidth)

Automatically adjust width to fit content changes.

## Relationships

### Conforms To

[`OptionSet`](/documentation/Swift/OptionSet)

[`RawRepresentable`](/documentation/Swift/RawRepresentable)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`Equatable`](/documentation/Swift/Equatable)

[`ExpressibleByArrayLiteral`](/documentation/Swift/ExpressibleByArrayLiteral)

[`Sendable`](/documentation/Swift/Sendable)

[`SetAlgebra`](/documentation/Swift/SetAlgebra)

---

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)