---
title: PresentationSizing
framework: swiftui
role: symbol
role_heading: Protocol
path: swiftui/presentationsizing
---

# PresentationSizing

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

## Declaration

```swift
protocol PresentationSizing
```

## Overview

Overview You don’t need to define your own version of this protocol. The system implementations of form, page, and 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:). 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)) note: presentationSizing(_:)

## Topics

### Getting built-in presentation size

- [automatic](swiftui/presentationsizing/automatic.md)
- [fitted](swiftui/presentationsizing/fitted.md)
- [form](swiftui/presentationsizing/form.md)
- [page](swiftui/presentationsizing/page.md)

### Creating custom presentation size

- [fitted(horizontal:vertical:)](swiftui/presentationsizing/fitted(horizontal:vertical:).md)
- [proposedSize(for:context:)](swiftui/presentationsizing/proposedsize(for:context:).md)
- [sticky(horizontal:vertical:)](swiftui/presentationsizing/sticky(horizontal:vertical:).md)

### Supporting types

- [AutomaticPresentationSizing](swiftui/automaticpresentationsizing.md)
- [FittedPresentationSizing](swiftui/fittedpresentationsizing.md)
- [FormPresentationSizing](swiftui/formpresentationsizing.md)
- [PagePresentationSizing](swiftui/pagepresentationsizing.md)

## Relationships

### Conforming Types

- [AutomaticPresentationSizing](swiftui/automaticpresentationsizing.md)
- [FittedPresentationSizing](swiftui/fittedpresentationsizing.md)
- [FormPresentationSizing](swiftui/formpresentationsizing.md)
- [PagePresentationSizing](swiftui/pagepresentationsizing.md)

## See Also

### Adapting a presentation size

- [presentationCompactAdaptation(horizontal:vertical:)](swiftui/view/presentationcompactadaptation(horizontal:vertical:).md)
- [presentationCompactAdaptation(_:)](swiftui/view/presentationcompactadaptation(_:).md)
- [PresentationAdaptation](swiftui/presentationadaptation.md)
- [presentationSizing(_:)](swiftui/view/presentationsizing(_:).md)
- [PresentationSizingRoot](swiftui/presentationsizingroot.md)
- [PresentationSizingContext](swiftui/presentationsizingcontext.md)
