---
title: Custom layout
framework: swiftui
role: collectionGroup
role_heading: API Collection
path: swiftui/custom-layout
---

# Custom layout

Place views in custom arrangements and create animated transitions between layout types.

## Overview

Overview You can create complex view layouts using the built-in layout containers and layout view modifiers that SwiftUI provides. However, if you need behavior that you can’t achieve with the built-in layout tools, create a custom layout container type using the Layout protocol. A container that you define asks for the sizes of all its subviews, and then indicates where to place the subviews within its own bounds.

You can also create animated transitions among layout types that conform to the Layout procotol, including both built-in and custom layouts. For design guidance, see Layout in the Human Interface Guidelines.

## Topics

### Creating a custom layout container

- [Composing custom layouts with SwiftUI](swiftui/composing-custom-layouts-with-swiftui.md)
- [Layout](swiftui/layout.md)
- [LayoutSubview](swiftui/layoutsubview.md)
- [LayoutSubviews](swiftui/layoutsubviews.md)

### Configuring a custom layout

- [LayoutProperties](swiftui/layoutproperties.md)
- [ProposedViewSize](swiftui/proposedviewsize.md)
- [ViewSpacing](swiftui/viewspacing.md)

### Associating values with views in a custom layout

- [layoutValue(key:value:)](swiftui/view/layoutvalue(key:value:).md)
- [LayoutValueKey](swiftui/layoutvaluekey.md)

### Transitioning between layout types

- [AnyLayout](swiftui/anylayout.md)
- [HStackLayout](swiftui/hstacklayout.md)
- [VStackLayout](swiftui/vstacklayout.md)
- [ZStackLayout](swiftui/zstacklayout.md)
- [GridLayout](swiftui/gridlayout.md)

## See Also

### View layout

- [Layout fundamentals](swiftui/layout-fundamentals.md)
- [Layout adjustments](swiftui/layout-adjustments.md)
- [Lists](swiftui/lists.md)
- [Tables](swiftui/tables.md)
- [View groupings](swiftui/view-groupings.md)
- [Scroll views](swiftui/scroll-views.md)
