<!--
{
  "availability" : [
    "iOS: 18.0.0 -",
    "iPadOS: 18.0.0 -",
    "macCatalyst: 18.0.0 -",
    "macOS: 15.0.0 -",
    "tvOS: 18.0.0 -",
    "visionOS: 2.0.0 -",
    "watchOS: 11.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/PresentationSizing",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI18PresentationSizingP"
  },
  "title" : "PresentationSizing"
}
-->

# PresentationSizing

A type that defines the size of the presentation content and how the
presentation size adjusts to its content’s size changing.

```
protocol PresentationSizing
```

## Overview

You don’t need to define your own version of this protocol. The system
implementations of [`form`](/documentation/SwiftUI/PresentationSizing/form), [`page`](/documentation/SwiftUI/PresentationSizing/page),
and [`fitted`](/documentation/SwiftUI/PresentationSizing/fitted) are conveniences that automatically
adapt to different device and screen sizes. If you do want to define your own
sizing, first consider using the modifiers
`PresenationSizing/sticky(horizontal:vertical:)` and
[`fitted(horizontal:vertical:)`](/documentation/SwiftUI/PresentationSizing/fitted(horizontal:vertical:)). For example, to
define your own sizing that proposes a 400x400 square size:

```
protocol SquareSizing: PresentationSizing {
    func proposedSize(
        for subview: PresentationSizingRoot,
        context: PresentationSizingContext
    ) {
        .init(width: 400, height: 400)
    }
}

extension PresentationSizing where Self == SquareSizing {
    public static var square: Self { SquareSizing() }
}
```

Then, at the callsite, you can modify `.square` just like system sizings,
for example, to fit its content vertically:

```
.presentationSizing(.square.fitted(horizontal: false, vertical: true))
```

> Seealso: ``doc://com.apple.SwiftUI/documentation/SwiftUI/View/presentationSizing(_:)``

## Topics

### Getting built-in presentation size

[`automatic`](/documentation/SwiftUI/PresentationSizing/automatic)

The default presentation sizing, appropriate for the platform.

[`fitted`](/documentation/SwiftUI/PresentationSizing/fitted)

The presentation sizing is dictated by the ideal size of the content

[`form`](/documentation/SwiftUI/PresentationSizing/form)

The size is appropriate for forms and slightly less wide than`.page`

[`page`](/documentation/SwiftUI/PresentationSizing/page)

The size is roughly the size of a page of paper, appropriate for
informational or compositional content.

### Creating custom presentation size

[`fitted(horizontal:vertical:)`](/documentation/SwiftUI/PresentationSizing/fitted(horizontal:vertical:))

[`proposedSize(for:context:)`](/documentation/SwiftUI/PresentationSizing/proposedSize(for:context:))

[`sticky(horizontal:vertical:)`](/documentation/SwiftUI/PresentationSizing/sticky(horizontal:vertical:))

Modifies self to be sticky in the specified dimensions — growing, but
not shrinking.

### Supporting types

[`AutomaticPresentationSizing`](/documentation/SwiftUI/AutomaticPresentationSizing)

The default presentation sizing, appropriate for the platform.

[`FittedPresentationSizing`](/documentation/SwiftUI/FittedPresentationSizing)

The size of the presentation is dictated by the ideal size of the content.

[`FormPresentationSizing`](/documentation/SwiftUI/FormPresentationSizing)

The size is appropriate for forms and slightly less wide than`.page`

[`PagePresentationSizing`](/documentation/SwiftUI/PagePresentationSizing)

The size is roughly the size of a page of paper, appropriate for
informational or compositional content.



---

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)