---
title: "ViewThatFits Components | Explore SwiftUI"
description: "A view that adapts to the available space by providing the first child view that fits. Explore 2 SwiftUI viewthatfits components with visual code examples."
canonical_url: "https://exploreswiftui.com/library/viewthatfits"
meta:
  author: "Explore SwiftUI"
  "og:description": "A view that adapts to the available space by providing the first child view that fits. Explore 2 SwiftUI viewthatfits components with visual code examples."
  "og:image": "https://exploreswiftui.com/_og/d/c_Default%2Ctitle_ViewThatFits%2BComponents%2Cdescription_Explore%2B2%2BSwiftUI%2Bcomponents%2Bvisually%2Cp_Ii9saWJyYXJ5L3ZpZXd0aGF0Zml0cyI%2Cs_37mszIopPOLLW2gQ.png"
  "og:image:height": "630"
  "og:image:type": image/png
  "og:image:width": "1200"
  "og:title": "ViewThatFits Components | Explore SwiftUI"
  "twitter:description": "A view that adapts to the available space by providing the first child view that fits. Explore 2 SwiftUI viewthatfits components with visual code examples."
  "twitter:image": "https://exploreswiftui.com/_og/d/c_Default%2Ctitle_ViewThatFits%2BComponents%2Cdescription_Explore%2B2%2BSwiftUI%2Bcomponents%2Bvisually%2Cp_Ii9saWJyYXJ5L3ZpZXd0aGF0Zml0cyI%2Cs_37mszIopPOLLW2gQ.png"
  "twitter:title": "ViewThatFits Components | Explore SwiftUI"
---

> Index of every page on this site: [llms.txt](https://exploreswiftui.com/llms.txt)

# **ViewThatFits Components**

A view that adapts to the available space by providing the first child view that fits.

2 components

![ViewThatFits Vertical - iOS on iPhone - Portrait - Flat Design - Light Mode - Preview](https://exploreswiftui.com/api/images/6/variants/20?v=1790073478842&r=2&w=412&q=75&f=webp)

### **ViewThatFits Vertical**

A view that adapts to the available vertical space by providing the first child view that fits.

![ViewThatFits - iOS on iPhone - Portrait - Flat Design - Light Mode - Preview](https://exploreswiftui.com/api/images/5/variants/1?v=1790073478842&r=2&w=412&q=75&f=webp)

### **ViewThatFits**

A view that adapts to the available space by providing the first child view that fits.

```json
{"@context":"https://schema.org","@graph":[{"@id":"https://exploreswiftui.com/#website","@type":"WebSite","description":"A visual library for SwiftUI APIs, components, and modifiers","inLanguage":"en-US","name":"Explore SwiftUI","url":"https://exploreswiftui.com/","publisher":{"@id":"https://exploreswiftui.com/#identity"}},{"@id":"https://exploreswiftui.com/library/viewthatfits#webpage","@type":"WebPage","description":"A view that adapts to the available space by providing the first child view that fits. Explore 2 SwiftUI viewthatfits components with visual code examples.","name":"ViewThatFits Components","url":"https://exploreswiftui.com/library/viewthatfits","breadcrumb":{"@id":"https://exploreswiftui.com/library/viewthatfits#breadcrumb"},"isPartOf":{"@id":"https://exploreswiftui.com/#website"},"potentialAction":[{"@type":"ReadAction","target":["https://exploreswiftui.com/library/viewthatfits"]}],"primaryImageOfPage":{"@id":"https://exploreswiftui.com/#logo"}},{"@id":"https://exploreswiftui.com/#identity","@type":"Organization","description":"A visual library for SwiftUI APIs, components, and modifiers","name":"Explore SwiftUI","url":"https://exploreswiftui.com","logo":{"@id":"https://exploreswiftui.com/#logo"},"sameAs":["https://x.com/Typ0genius","https://mastodon.social/@Typ0genius"]},{"@id":"https://exploreswiftui.com/library/viewthatfits#collectionpage","@type":"CollectionPage","description":"A view that adapts to the available space by providing the first child view that fits. Explore 2 SwiftUI viewthatfits components with visual code examples.","inLanguage":"en-US","name":"ViewThatFits Components","url":"https://exploreswiftui.com/library/viewthatfits","about":{"@type":"Thing","name":"SwiftUI"},"isPartOf":{"@id":"https://exploreswiftui.com/#website"}},{"@id":"https://exploreswiftui.com/library/viewthatfits#/schema/item-list/1","@type":"ItemList","name":"ViewThatFits Components","itemListElement":[{"@type":"ListItem","position":1,"name":"ViewThatFits Vertical","url":"https://exploreswiftui.com/library/viewthatfits/viewthatfits-vertical"},{"@type":"ListItem","position":2,"name":"ViewThatFits","url":"https://exploreswiftui.com/library/viewthatfits/viewthatfits"}]},{"@id":"https://exploreswiftui.com/library/viewthatfits#breadcrumb","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","name":"Home","item":"https://exploreswiftui.com","position":1},{"@type":"ListItem","name":"ViewThatFits","item":"https://exploreswiftui.com/library/viewthatfits","position":2}]},{"@id":"https://exploreswiftui.com/#logo","@type":"ImageObject","caption":"Explore SwiftUI","contentUrl":"https://exploreswiftui.com/apple-touch-icon.png","inLanguage":"en","url":"https://exploreswiftui.com/apple-touch-icon.png"}]}
```