---
title: sizeThatFitsLayout
framework: developertoolssupport
role: symbol
role_heading: Type Property
path: developertoolssupport/previewtrait/sizethatfitslayout
---

# sizeThatFitsLayout

Fit the container to the size of the preview when offered the size of the device that the preview is running on.

## Declaration

```swift
@MainActor static var sizeThatFitsLayout: PreviewTrait<Preview.ViewTraits> { get }
```

## Discussion

Discussion This is the same as PreviewLayout.sizeThatFits.

## See Also

### Getting a layout

- [defaultLayout](developertoolssupport/previewtrait/defaultlayout.md)
- [fixedLayout(width:height:)](developertoolssupport/previewtrait/fixedlayout(width:height:).md)
- [fixedLayout(width:height:depth:)](developertoolssupport/previewtrait/fixedlayout(width:height:depth:).md)
